Skip to content

Commit

Permalink
Change Installer.store_directory to be an absolute path
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancisMurillo committed May 21, 2023
1 parent ba91e79 commit 734ede8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ jobs:
"$SYNC_DIR/tool" --config="tests/$SYNC_DIR.toml" sync > /dev/null 2> out
cat out
if ! grep -q '1 tools!' out; then echo "error on: tool"; false; fi
if ! grep -q 'tools!' out; then echo "error on: tool"; false; fi
- if: matrix.os != 'windows-latest'
name: "Integration test: [unix] [sync-full]"
Expand Down
8 changes: 1 addition & 7 deletions src/sync/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,7 @@ fn copy_file(
install_path.push(store_directory);
install_path.push(exe_name);

// DANGER: This check does not really mean two paths resolve to the
// same file. For example, the exe path /a/b/c.exe is not the same
// as install path b/c.exe if the current working directory is in /d
// instead of /a. Perhaps expand store directory to absolute or use
// `BurntSushi/same-file`?
eprintln!("KK-{}", &install_path.display());
if self_path.ends_with(&install_path) {
if self_path == &install_path {
// May have issues with a symbolic links. The assumption is that
// the store directory is in the PATH and the executable itself
// where this issue should not apply but may be an edge case.
Expand Down

0 comments on commit 734ede8

Please sign in to comment.