@@ -28,32 +28,35 @@ check_cmd() {
2828}
2929
3030# Check if the commands to be used exist.
31- for cmd in curl unzip; do
31+ for cmd in curl unzip awk ; do
3232 check_cmd $cmd
3333done
3434
3535get_latest_release_number () {
3636 curl --silent " https://github.com/sourceplusplus/interface-cli/releases/latest" | sed ' s#.*tag/\(.*\)\".*#\1#'
3737}
3838
39+ # Convert the string to lower case.
40+ OS=$( echo $OS | awk ' {print tolower($0)}' )
41+
3942# Get the latest version of spp-cli.
4043VERSION=$( get_latest_release_number)
4144echo " Installing spp-cli $VERSION "
4245
4346# Download the binary package.
44- curl -sSLO " https://github.com/sourceplusplus/interface-cli/releases/download/$VERSION /spp-cli-$VERSION -linux64 .zip" > /dev/null
45- if [ -f " spp-cli-$VERSION -linux64 .zip" ]; then
46- unzip -q spp-cli-$VERSION -linux64 .zip
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
4750
4851 echo " Adding spp-cli to your PATH"
4952 # Add spp-cli to the environment variable PATH.
5053 sudo mv spp-cli /usr/local/bin/spp-cli
5154
5255 # Delete unnecessary files.
53- rm " ./spp-cli-$VERSION -linux64 .zip"
56+ rm " ./spp-cli-$VERSION -${OS} 64 .zip"
5457 echo " Installation complete."
5558
5659 echo " Type 'spp-cli --help' to get more information."
5760else
58- abort " Failed to download spp-cli-$VERSION -linux64 .zip"
61+ abort " Failed to download spp-cli-$VERSION -${OS} 64 .zip"
5962fi
0 commit comments