Add support for .node-version files with multiple package versions

feature/lookup-installed
trivernis 2 years ago
parent a634f2be47
commit a3605e4317
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -19,7 +19,12 @@ impl VersionDetector for VersionFileDetector {
.await .await
.into_diagnostic() .into_diagnostic()
.context("Reading version file.")?; .context("Reading version file.")?;
Ok(NodeVersion::from_str(&version_string).ok()) let version = version_string
.lines()
.into_iter()
.find_map(|l| NodeVersion::from_str(l).ok());
Ok(version)
} else { } else {
Ok(None) Ok(None)
} }

Loading…
Cancel
Save