Skip to content

Commit 6637851

Browse files
committed
refactor
1 parent 94a8410 commit 6637851

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

scripts/install.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,22 @@ OS=$(echo $OS | awk '{print tolower($0)}')
4343
VERSION=$(get_latest_release_number)
4444
echo "Installing spp-cli $VERSION"
4545

46+
ARCHIVE_NAME="spp-cli-$VERSION-${OS}64.zip"
47+
4648
# Download the binary package.
47-
curl -sSLO "https://github.com/sourceplusplus/interface-cli/releases/download/$VERSION/spp-cli-$VERSION-${OS}64.zip" > /dev/null
48-
if [ -f "spp-cli-$VERSION-${OS}64.zip" ]; then
49-
unzip -q spp-cli-$VERSION-${OS}64.zip
49+
curl -sSLO "https://github.com/sourceplusplus/interface-cli/releases/download/$VERSION/$ARCHIVE_NAME" > /dev/null
50+
if [ -f "$ARCHIVE_NAME" ]; then
51+
unzip -q $ARCHIVE_NAME
5052

5153
echo "Adding spp-cli to your PATH"
5254
# Add spp-cli to the environment variable PATH.
5355
sudo mv spp-cli /usr/local/bin/spp-cli
5456

5557
# Delete unnecessary files.
56-
rm "./spp-cli-$VERSION-${OS}64.zip"
58+
rm "./$ARCHIVE_NAME"
5759
echo "Installation complete."
5860

5961
echo "Type 'spp-cli --help' to get more information."
6062
else
61-
abort "Failed to download spp-cli-$VERSION-${OS}64.zip"
63+
abort "Failed to download $ARCHIVE_NAME"
6264
fi

0 commit comments

Comments
 (0)