Skip to content

Commit

Permalink
chore(repo): prevent bugs from paths in spaces
Browse files Browse the repository at this point in the history
Add quotes to shell variables to prevent unexpected behavior if the
install script is executed from a directory with a space in its name.
  • Loading branch information
klaude authored and P0lip committed Jul 24, 2023
1 parent 08f7d66 commit 5709399
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ fi
SRC="$(pwd)/${FILENAME}"
DEST=/usr/local/bin/spectral

STATUS=$(curl -sL -w %{http_code} -o $SRC $URL)
STATUS=$(curl -sL -w %{http_code} -o "$SRC" "$URL")
if [ $STATUS -ge 200 ] & [ $STATUS -le 308 ]; then
mv $SRC $DEST
chmod +x $DEST
mv "$SRC" "$DEST"
chmod +x "$DEST"
echo "Spectral was installed to: ${DEST}"
else
rm $SRC
rm "$SRC"
echo "Error requesting. Download binary from ${URL}"
exit 1
fi
Expand Down

0 comments on commit 5709399

Please sign in to comment.