diff options
author | Bert Belder <bertbelder@gmail.com> | 2021-07-20 17:52:09 +0000 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2021-07-20 19:06:40 -0700 |
commit | 63546c15bfb1284ac6d956eee274e6d7cf263a8f (patch) | |
tree | 6c5bbee07db6917354bd64911705aed78f6f36b1 | |
parent | c34fef4b71a8bf7b0e942107b63b138d137f27d5 (diff) |
fix(cli): rebuild when environment variables change (#11471)
-rw-r--r-- | cli/build.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/cli/build.rs b/cli/build.rs index 548fbb501..d7bed218c 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -269,8 +269,17 @@ fn main() { // To debug snapshot issues uncomment: // op_fetch_asset::trace_serializer(); - println!("cargo:rustc-env=TS_VERSION={}", ts_version()); + if let Ok(c) = env::var("DENO_CANARY") { + println!("cargo:rustc-env=DENO_CANARY={}", c); + } + println!("cargo:rerun-if-env-changed=DENO_CANARY"); + println!("cargo:rustc-env=GIT_COMMIT_HASH={}", git_commit_hash()); + println!("cargo:rerun-if-env-changed=GIT_COMMIT_HASH"); + + println!("cargo:rustc-env=TS_VERSION={}", ts_version()); + println!("cargo:rerun-if-env-changed=TS_VERSION"); + println!( "cargo:rustc-env=DENO_CONSOLE_LIB_PATH={}", deno_console::get_declaration().display() @@ -322,9 +331,6 @@ fn main() { println!("cargo:rustc-env=TARGET={}", env::var("TARGET").unwrap()); println!("cargo:rustc-env=PROFILE={}", env::var("PROFILE").unwrap()); - if let Ok(c) = env::var("DENO_CANARY") { - println!("cargo:rustc-env=DENO_CANARY={}", c); - } let c = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap()); let o = PathBuf::from(env::var_os("OUT_DIR").unwrap()); |