From 595b4daa77771458457e178b6b590a044cd41ad0 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Sat, 7 Sep 2019 01:57:15 +0900 Subject: Remove replacements hack in deno_typescript (#2864) --- cli/ops/os.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'cli/ops') diff --git a/cli/ops/os.rs b/cli/ops/os.rs index d644d893b..61484ca41 100644 --- a/cli/ops/os.rs +++ b/cli/ops/os.rs @@ -11,6 +11,16 @@ use std::collections::HashMap; use std::env; use url::Url; +/// BUILD_OS and BUILD_ARCH match the values in Deno.build. See js/build.ts. +#[cfg(target_os = "macos")] +static BUILD_OS: &str = "mac"; +#[cfg(target_os = "linux")] +static BUILD_OS: &str = "linux"; +#[cfg(target_os = "windows")] +static BUILD_OS: &str = "win"; +#[cfg(target_arch = "x86_64")] +static BUILD_ARCH: &str = "x64"; + pub fn op_start( state: &ThreadSafeState, _args: Value, @@ -31,6 +41,8 @@ pub fn op_start( "tsVersion": version::typescript(), "noColor": !ansi::use_color(), "xevalDelim": state.flags.xeval_delim.clone(), + "os": BUILD_OS, + "arch": BUILD_ARCH, }))) } -- cgit v1.2.3