Skip to content

Commit 89cfc58

Browse files
committed
fix(foundryup): check if file exists before moving
1 parent 52ecd5c commit 89cfc58

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

foundryup/foundryup

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,12 @@ EOF
206206
# Build the repo and install the binaries locally to the .foundry bin directory.
207207
ensure cargo build --bins --release
208208
for bin in "${BINS[@]}"; do
209-
mv -f "target/release/$bin" "target/release/$bin.exe" "$FOUNDRY_DIR"
209+
for try_path in target/release/$bin target/release/$bin.exe; do
210+
if [ -f "$try_path" ]; then
211+
[ -e "$FOUNDRY_BIN_DIR/$bin" ] && warn "overwriting existing $bin in $FOUNDRY_BIN_DIR"
212+
mv -f "$try_path" "$FOUNDRY_BIN_DIR"
213+
fi
214+
done
210215
done
211216

212217
# If help2man is installed, use it to add Foundry man pages.

0 commit comments

Comments
 (0)