summaryrefslogtreecommitdiff
path: root/src/ops.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-02-08 22:13:04 -0500
committerGitHub <noreply@github.com>2019-02-08 22:13:04 -0500
commit526497bc29faaf99354ee5d1628e8681d6604736 (patch)
treefb1168018acbc594cc6df0e9e2dc9e9929c01aa0 /src/ops.rs
parent4c869dc8851527756b774e3ea202529aa2b3ae1e (diff)
Adds deno.noColor (#1716)
Diffstat (limited to 'src/ops.rs')
-rw-r--r--src/ops.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/ops.rs b/src/ops.rs
index 86bc6efad..2b4136208 100644
--- a/src/ops.rs
+++ b/src/ops.rs
@@ -1,5 +1,7 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
+use atty;
+use crate::ansi;
use crate::errors;
use crate::errors::{DenoError, DenoResult, ErrorKind};
use crate::fs as deno_fs;
@@ -18,8 +20,6 @@ use crate::resources::table_entries;
use crate::resources::Resource;
use crate::tokio_util;
use crate::version;
-
-use atty;
use flatbuffers::FlatBufferBuilder;
use futures;
use futures::Async;
@@ -33,10 +33,6 @@ use std;
use std::convert::From;
use std::fs;
use std::net::Shutdown;
-#[cfg(unix)]
-use std::os::unix::fs::PermissionsExt;
-#[cfg(unix)]
-use std::os::unix::process::ExitStatusExt;
use std::path::Path;
use std::path::PathBuf;
use std::process::Command;
@@ -48,6 +44,11 @@ use tokio::net::TcpStream;
use tokio_process::CommandExt;
use tokio_threadpool;
+#[cfg(unix)]
+use std::os::unix::fs::PermissionsExt;
+#[cfg(unix)]
+use std::os::unix::process::ExitStatusExt;
+
type OpResult = DenoResult<Buf>;
// TODO Ideally we wouldn't have to box the Op being returned.
@@ -266,6 +267,7 @@ fn op_start(
version_flag: state.flags.version,
v8_version: Some(v8_version_off),
deno_version: Some(deno_version_off),
+ no_color: !ansi::use_color(),
..Default::default()
},
);