Skip to content

Commit

Permalink
feat: add profile
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k committed Oct 31, 2020
1 parent 1aedd38 commit 0cda394
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
19 changes: 10 additions & 9 deletions cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,18 @@ fn ts_version() -> String {
}

fn git_commit_hash() -> String {
let output = std::process::Command::new("git")
if let Ok(output) = std::process::Command::new("git")
.arg("rev-list")
.arg("-1")
.arg("HEAD")
.output()
.expect("failed to execute process");
std::str::from_utf8(&output.stdout[..7])
.unwrap()
.to_string()
{
std::str::from_utf8(&output.stdout[..7])
.unwrap()
.to_string()
} else {
"UNKNOWN".to_string()
}
}

fn main() {
Expand All @@ -136,10 +139,8 @@ fn main() {
deno_fetch::get_declaration().display()
);

println!(
"cargo:rustc-env=TARGET={}",
std::env::var("TARGET").unwrap()
);
println!("cargo:rustc-env=TARGET={}", env::var("TARGET").unwrap());
println!("cargo:rustc-env=PROFILE={}", env::var("PROFILE").unwrap());

let c = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap());
let o = PathBuf::from(env::var_os("OUT_DIR").unwrap());
Expand Down
3 changes: 2 additions & 1 deletion cli/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,10 @@ To evaluate code in the shell:

lazy_static! {
static ref LONG_VERSION: String = format!(
"{} ({}, {})\nv8 {}\ntypescript {}",
"{} ({}, {}, {})\nv8 {}\ntypescript {}",
crate::version::DENO,
crate::version::GIT_COMMIT_HASH,
env!("PROFILE"),
env!("TARGET"),
crate::version::v8(),
crate::version::TYPESCRIPT
Expand Down

0 comments on commit 0cda394

Please sign in to comment.