-
-
Notifications
You must be signed in to change notification settings - Fork 819
Adding --verbose flag to check commit hash #4568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I've left a couple comments on the code here, but I don't think we have agreed on a design yet so let's go back to the issue and discuss it prior to implementing anything further.
.filter(|s| !s.is_empty()) | ||
.unwrap_or_else(|| "unknown".to_string()); | ||
|
||
println!("cargo:rustc-env=GIT_COMMIT_HASH={}", commit_hash); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a huge fan of shelling out to run a program each time. We could do something like this perhaps
const GIT_SHA: &str = if include_str!("../../.git/HEAD") == "ref: refs/heads/main" {
include_str!("../../.git/refs/heads/main")
} else {
include_str!("../../.git/HEAD")
}
styles = Styles::styled() | ||
.header(styling::AnsiColor::Yellow.on_default()) | ||
.usage(styling::AnsiColor::Yellow.on_default()) | ||
.literal(styling::AnsiColor::Green.on_default()) | ||
)] | ||
struct Cli { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No abbreviations please
} | ||
}, | ||
None => { | ||
println!("Use `gleam --help` to see available commands."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change! No other functionality must change
This PR adds a
--verbose
flag to thegleam --version
command. When used, it will include the current git commit hash in the output.Usage
Closes #4544