-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from posit-dev/feature/ark-version-display
Add a way to see the Ark version from Positron
- Loading branch information
Showing
6 changed files
with
119 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// build.rs | ||
// | ||
// Copyright (C) 2023 Posit Software, PBC. All rights reserved. | ||
// | ||
// | ||
|
||
use std::process::Command; | ||
|
||
fn main() { | ||
// Attempt to use `git rev-parse HEAD` to get the current git hash. If this | ||
// fails, we'll just use the string "<unknown>" to indicate that the git hash | ||
// could not be determined.. | ||
let git_hash = match Command::new("git") | ||
.args(&["rev-parse", "--short", "HEAD"]) | ||
.output() | ||
{ | ||
Ok(output) => String::from_utf8(output.stdout).unwrap(), | ||
Err(_) => String::from("<unknown>"), | ||
}; | ||
println!("cargo:rustc-env=BUILD_GIT_HASH={}", git_hash); | ||
|
||
// Get the build date as a string | ||
let build_date = chrono::Utc::now().to_rfc3339_opts(chrono::SecondsFormat::Secs, true); | ||
println!("cargo:rustc-env=BUILD_DATE={}", build_date); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,7 @@ | |
} | ||
|
||
} | ||
|
||
.ps.ark.version <- function() { | ||
.ps.Call("ps_ark_version") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters