From 0852c87bf33b833095644e649bbcedbf89ad4f82 Mon Sep 17 00:00:00 2001 From: Eugene Burkov Date: Mon, 17 May 2021 13:49:27 +0300 Subject: [PATCH] scripts: add os-specific requirements check --- scripts/install.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index bdee88b6f06..37d919a286f 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -43,14 +43,27 @@ is_little_endian() { # machine. The required software (only one requirement for now): # # curl +# unzip (macOS) +# tar (linux) # check_required() { + readonly spec_darwin="unzip" + readonly spec_linux="tar" + # Split with space. - readonly required="curl" + required="curl" + if [ "$os" = 'linux' ] + then + required="$required $spec_linux" + elif [ "$os" = 'darwin' ] + then + required="$required $spec_darwin" + fi # Don't use quotes to get word splitting. for cmd in ${required} do + echo "checking $cmd" if ! is_command "$cmd" then log "the full list of required software: [$required]" @@ -454,13 +467,12 @@ cpu='' os='' out_dir='/opt' pkg_ext='tar.gz' - parse_opts $* -check_required echo 'starting AdGuard Home installation script' configure +check_required if ! is_root then