From fc5cc3c43b3ad17bec3271d02c8ae0af94291e89 Mon Sep 17 00:00:00 2001 From: Matt Thomson <771863+matt-thomson@users.noreply.github.com> Date: Thu, 19 Jun 2025 10:29:11 +0100 Subject: [PATCH] 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) --- src/steps/os/unix.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/steps/os/unix.rs b/src/steps/os/unix.rs index fc54b7d1..3245cf26 100644 --- a/src/steps/os/unix.rs +++ b/src/steps/os/unix.rs @@ -654,11 +654,15 @@ pub fn run_asdf(ctx: &ExecutionContext) -> Result<()> { // $ asdf version // v0.16.7 // ``` + // ``` + // $ asdf version + // 0.18.0 (revision unknown) + // ``` let version_stdout = version_output.stdout.trim(); // trim the starting 'v' let mut remaining = version_stdout.trim_start_matches('v'); - // remove the hash part if present - if let Some(idx) = remaining.find('-') { + // remove the hash or revision part if present + if let Some(idx) = remaining.find(['-', ' ']) { remaining = &remaining[..idx]; } let version =