Skip to content

Commit

Permalink
fix(install.sh): use the error function
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneM committed Jul 31, 2023
1 parent cfe8dc1 commit 5cde48d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions dists/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ main() {
}

error() {
echo -en " ! $*"
echo -en " ! $*" >&2
}

warn() {
Expand Down Expand Up @@ -112,8 +112,8 @@ main() {

version=$(curl --silent https://cli-dl.scalingo.com/version | tr -d ' \t\n')
if [ -z "$version" ]; then
echo "-----> Fail to get the version of the CLI" >&2
echo "You probably have an old version of curl. Please check your curl version and update accordingly." >&2
error "Fail to get the version of the CLI\n"
error "You probably have an old version of curl. Please check your curl version and update accordingly.\n"
exit 1
fi

Expand All @@ -124,8 +124,8 @@ main() {
status "Downloading Scalingo client... "
curl --silent --fail --location --output ${tmpdir}/${archive_name} ${url}
if [ ! -f ${tmpdir}/${archive_name} ]; then
echo "" >&2
echo "-----> Fail to download the CLI archive" >&2
echo ""
error "Fail to download the CLI archive\n"
exit 1
fi
echo "DONE"
Expand All @@ -148,8 +148,8 @@ main() {

exe_path=${tmpdir}/${dirname}/scalingo
if [ ! -f "$exe_path" ]; then
echo "" >&2
echo "-----> Fail to extract the CLI archive" >&2
echo ""
error "Fail to extract the CLI archive\n"
exit 1
fi
echo "DONE"
Expand Down

0 comments on commit 5cde48d

Please sign in to comment.