Skip to content

Commit

Permalink
🐛 (install): fix shell script syntax to prevent word splitting and gl…
Browse files Browse the repository at this point in the history
…obbing issues

The changes made in the script include adding the -r flag to the read command to prevent backslashes from being interpreted as escape characters, and quoting variables to prevent word splitting and globbing issues. This ensures that the script behaves as expected and handles file paths and package names correctly.
  • Loading branch information
ahatzenbuhler committed Sep 30, 2024
1 parent ec9b0c0 commit a26218d
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,16 @@ install_default_rust_packages() {

if [ -f "$packages_file" ]; then
echo -ne "\nInstalling default rust packages..."
while read package
do
while read -r package; do
echo -ne "\nInstalling rust package $package..."
echo "Pouet : $ASDF_INSTALL_PATH"
PATH="$ASDF_INSTALL_PATH/bin:$PATH" cargo install -f --locked "$package" --root "$ASDF_INSTALL_PATH/.cargo"
done < "$packages_file"
for binary in "$ASDF_INSTALL_PATH/.cargo/bin"/*
do
ln -s "$binary" "$ASDF_INSTALL_PATH/bin/$(basename $binary)"
done <"$packages_file"
for binary in "$ASDF_INSTALL_PATH/.cargo/bin"/*; do
ln -s "$binary" "$ASDF_INSTALL_PATH/bin/$(basename "$binary")"
done
fi
}


install_rust "$ASDF_INSTALL_TYPE" "$ASDF_INSTALL_VERSION" "$ASDF_INSTALL_PATH"
install_default_rust_packages

0 comments on commit a26218d

Please sign in to comment.