summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/deno.ts2
-rw-r--r--js/main.ts2
-rw-r--r--js/os.ts6
3 files changed, 7 insertions, 3 deletions
diff --git a/js/deno.ts b/js/deno.ts
index 42bd38013..5f3998116 100644
--- a/js/deno.ts
+++ b/js/deno.ts
@@ -1,7 +1,7 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
// Public deno module.
-export { pid, env, exit, isTTY } from "./os";
+export { noColor, pid, env, exit, isTTY } from "./os";
export { chdir, cwd } from "./dir";
export {
File,
diff --git a/js/main.ts b/js/main.ts
index b26cefcbf..4151abe75 100644
--- a/js/main.ts
+++ b/js/main.ts
@@ -39,7 +39,7 @@ export default function denoMain() {
os.exit(0);
}
- os.setPid(startResMsg.pid());
+ os.setGlobals(startResMsg.pid(), startResMsg.noColor());
const cwd = startResMsg.cwd();
log("cwd", cwd);
diff --git a/js/os.ts b/js/os.ts
index 3122830cf..d8c3288d5 100644
--- a/js/os.ts
+++ b/js/os.ts
@@ -9,9 +9,13 @@ import * as util from "./util";
/** process id */
export let pid: number;
-export function setPid(pid_: number): void {
+/** Reflects the NO_COLOR enviromental variable: https://no-color.org/ */
+export let noColor: boolean;
+
+export function setGlobals(pid_: number, noColor_: boolean): void {
assert(!pid);
pid = pid_;
+ noColor = noColor_;
}
interface CodeInfo {