Handle another format change in asdf version (#1194)
This now includes a revision part which must be trimmed, e.g. 0.18.0 (revision unknown)
This commit is contained in:
@@ -654,11 +654,15 @@ pub fn run_asdf(ctx: &ExecutionContext) -> Result<()> {
|
|||||||
// $ asdf version
|
// $ asdf version
|
||||||
// v0.16.7
|
// v0.16.7
|
||||||
// ```
|
// ```
|
||||||
|
// ```
|
||||||
|
// $ asdf version
|
||||||
|
// 0.18.0 (revision unknown)
|
||||||
|
// ```
|
||||||
let version_stdout = version_output.stdout.trim();
|
let version_stdout = version_output.stdout.trim();
|
||||||
// trim the starting 'v'
|
// trim the starting 'v'
|
||||||
let mut remaining = version_stdout.trim_start_matches('v');
|
let mut remaining = version_stdout.trim_start_matches('v');
|
||||||
// remove the hash part if present
|
// remove the hash or revision part if present
|
||||||
if let Some(idx) = remaining.find('-') {
|
if let Some(idx) = remaining.find(['-', ' ']) {
|
||||||
remaining = &remaining[..idx];
|
remaining = &remaining[..idx];
|
||||||
}
|
}
|
||||||
let version =
|
let version =
|
||||||
|
|||||||
Reference in New Issue
Block a user