Skip to content

Commit

Permalink
fix(install): add some check of command before continue script execution
Browse files Browse the repository at this point in the history
  • Loading branch information
curzolapierre committed Sep 7, 2023
1 parent c1da93a commit 86597d7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dists/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ main() {
echo -en " /!\\ $*"
}

check_command_exists() {
if ! command -v $1 &> /dev/null
then
errors "$1 command could not be found, please install it first"
exit 1
fi
}

clean_install() {
tmpdir=$1

Expand Down Expand Up @@ -131,6 +139,9 @@ main() {
fi
echo "DONE"

check_command_exists sha256sum
check_command_exists wget

status "Verifying the checksum... "
checksums_url="https://github.com/Scalingo/cli/releases/download/${version}/checksums.txt"
# Use cut's short parameter to be compatible with MacOS: https://ss64.com/osx/cut.html
Expand Down

0 comments on commit 86597d7

Please sign in to comment.