From ccd2d383c2eb07567a2027d0a1fd37fdada3c148 Mon Sep 17 00:00:00 2001 From: Georg Krause Date: Thu, 27 Oct 2022 08:07:30 +0200 Subject: [PATCH] feat(installer): Check installation dependencies before execution --- install.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/install.sh b/install.sh index 25c7e2d..a5c2428 100755 --- a/install.sh +++ b/install.sh @@ -16,6 +16,24 @@ case $OS in ;; esac +# Check for install dependency availability +if ! [ -x "$(command -v curl)" ]; then + echo "❌ curl is required to execute the installation. Please install it and run the installer again!" + exit +fi +if ! [ -x "$(command -v unzip)" ]; then + echo "❌ Unzip is required to execute the installation. Please install it and run the installer again!" + exit +fi +if ! [ -x "$(command -v sudo)" ]; then + echo "❌ sudo is required to execute the installation. Please install it and run the installer again!" + exit +fi +if ! [ -x "$(command -v install)" ]; then + echo "❌ install is required to execute the installation. Please install it and run the installer again!" + exit +fi + download_url=$(curl -L -s https://api.github.com/repos/getdeck/getdeck/releases/latest | grep '"browser_download_url": ".*'$OS'.*"' | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*") file_name=$(echo $download_url | grep -oE '[^/]+$') curl -L $download_url -o /tmp/$file_name