Skip to content

Commit

Permalink
fix(install.sh): fail if fails to extract the CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneM committed Jul 22, 2022
1 parent 389d551 commit 727958e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions dists/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ main() {
done

tmpdir=$(mktemp -d /tmp/scalingo_cli_XXX)
trap "clean_install ${tmpdir}" EXIT
# trap "clean_install ${tmpdir}" EXIT

version=$(curl --silent https://cli-dl.scalingo.com/version | tr -d ' \t\n')
if [ -z "$version" ]; then
Expand Down Expand Up @@ -130,9 +130,15 @@ main() {
tar -C "${tmpdir}" -x -f "${tmpdir}/${archive_name}"
;;
esac
echo "DONE"

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

target_dir="${target_dir:-/usr/local/bin}"
target="$target_dir/scalingo"

Expand Down

0 comments on commit 727958e

Please sign in to comment.