Skip to content

Commit

Permalink
Add a relative path to the lockfile for bender clone
Browse files Browse the repository at this point in the history
All other path dependencies are relative if possible in the lockfile, so
we align to this behavior introduced in v0.27.0.
  • Loading branch information
micprog committed Feb 22, 2024
1 parent 3b489ec commit fb29fc0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/cmd/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,13 @@ pub fn run(sess: &Session, path: &Path, matches: &ArgMatches) -> Result<()> {
let mut mod_package = locked.packages[dep].clone();
mod_package.revision = None;
mod_package.version = None;
mod_package.source = LockedSource::Path(path.join(path_mod).join(dep));
mod_package.source = LockedSource::Path(
path.join(path_mod)
.join(dep)
.strip_prefix(path)
.unwrap_or(&path.join(path_mod).join(dep))
.to_path_buf(),
);
locked.packages.insert(dep.to_string(), mod_package);

let file = File::create(path.join("Bender.lock"))
Expand Down

0 comments on commit fb29fc0

Please sign in to comment.