@hackwaly/task 0.1.3 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hackwaly/task",
3
- "version": "0.1.3",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": "github:hackwaly/task",
@@ -17,7 +17,8 @@
17
17
  "execa": "^9.6.0",
18
18
  "micromatch": "^4.0.8",
19
19
  "rxjs": "^7.8.2",
20
- "string-argv": "^0.3.2"
20
+ "string-argv": "^0.3.2",
21
+ "supports-color": "^10.2.2"
21
22
  },
22
23
  "devDependencies": {
23
24
  "@types/micromatch": "^4.0.9",
package/src/cli.ts CHANGED
@@ -92,6 +92,7 @@ export async function cliMain(): Promise<void> {
92
92
  process.on("SIGINT", () => {
93
93
  aborter.abort();
94
94
  watcher.close();
95
+ process.exitCode = 0;
95
96
  });
96
97
  taskChan.next(topTaskSet);
97
98
  } else {
package/src/run.ts CHANGED
@@ -2,6 +2,9 @@ import type { Command, TaskMeta, TaskRunContext } from "./types.ts";
2
2
  import { execa } from "execa";
3
3
  import process from "node:process";
4
4
  import styles from "ansi-styles";
5
+ import supportsColor from "supports-color";
6
+
7
+ const colorSupport = supportsColor.stdout;
5
8
 
6
9
  export async function runCommand(
7
10
  command: Command,
@@ -22,7 +25,9 @@ export async function runCommand(
22
25
  await execa({
23
26
  // @ts-expect-error
24
27
  cwd: cwd,
25
- env: env,
28
+ env: colorSupport
29
+ ? { ...(env ?? {}), FORCE_COLOR: `${colorSupport.level}` }
30
+ : env,
26
31
  preferLocal: true,
27
32
  stdout: [transform, "inherit"],
28
33
  stderr: [transform, "inherit"],