Skip to content

Commit 734ede8

Browse files
Change Installer.store_directory to be an absolute path
1 parent ba91e79 commit 734ede8

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ jobs:
146146
147147
"$SYNC_DIR/tool" --config="tests/$SYNC_DIR.toml" sync > /dev/null 2> out
148148
cat out
149-
if ! grep -q '1 tools!' out; then echo "error on: tool"; false; fi
149+
if ! grep -q 'tools!' out; then echo "error on: tool"; false; fi
150150
151151
- if: matrix.os != 'windows-latest'
152152
name: "Integration test: [unix] [sync-full]"

src/sync/install.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,7 @@ fn copy_file(
117117
install_path.push(store_directory);
118118
install_path.push(exe_name);
119119

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

0 commit comments

Comments
 (0)