Skip to content

Commit 0d95320

Browse files
committed
Fix installing v0.0 packages
1 parent cfb5874 commit 0d95320

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

crates/lib/src/install.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,16 @@ async fn symlink(installation: &Installation, config: &Config) -> Result<(), Box
158158
"{}.{}",
159159
installation.pkg.version.major, installation.pkg.version.minor
160160
);
161-
let minor_range = VersionReq::caret(&v_mm)?;
161+
let minor_range = if installation.pkg.version.major > 0 {
162+
VersionReq::caret(&v_mm)?
163+
} else {
164+
VersionReq::parse(&format!(">={},<{}", v_mm, format!("0.{}", installation.pkg.version.minor + 1)))?
165+
};
162166
let most_minor = versions
163167
.iter()
164168
.filter(|(version, _)| minor_range.satisfies(version))
165169
.next_back()
166-
.ok_or_else(|| anyhow::anyhow!("Could not find most minor version"))?;
170+
.ok_or_else(|| anyhow::anyhow!("Could not find most minor version for {}", installation.pkg.project))?;
167171

168172
if most_minor.0 != installation.pkg.version {
169173
return Ok(());

0 commit comments

Comments
 (0)