From 727958ec5eb174df660fe54a7315f9b04a7a3270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Michon?= Date: Fri, 22 Jul 2022 16:59:44 +0200 Subject: [PATCH] fix(install.sh): fail if fails to extract the CLI --- dists/install.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dists/install.sh b/dists/install.sh index 6880d4509..fdee909e0 100755 --- a/dists/install.sh +++ b/dists/install.sh @@ -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 @@ -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"