From 970238461af75ce8436dd295ff0c9bd76e678c92 Mon Sep 17 00:00:00 2001 From: pvincent Date: Fri, 20 Aug 2021 15:29:47 +0400 Subject: [PATCH] fix: CURDIR instead of BASEDIR --- install.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 83f56ca..20b1bf1 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,7 @@ #!/bin/bash -BASEDIR=$PWD +CURDIR=$PWD +# shellcheck disable=SC1091 REQUIRED_PKGS=(jq rsync file git) function usage() { @@ -15,10 +16,10 @@ function install_host() { [ $(id -u) -ne 0 ] && echo 'root privilege required' && exit 1 # shellcheck disable=SC1091 - source "$BASEDIR/lib/functions.sh" + source "$CURDIR/lib/functions.sh" idem_apt_install "${REQUIRED_PKGS[@]}" - if [[ ! $BASEDIR == '/opt/debian-bash' ]]; then + if [[ ! $CURDIR == '/opt/debian-bash' ]]; then # download and filfull /opt/debian-bash, then run it from folder if [[ -L /opt/debian-bash ]]; then @@ -54,7 +55,7 @@ function install_host() { echo "$i needs installation $(basename $i)" mv "$i" "$i.$ORIGINAL" - ln -s "$BASEDIR/$(basename $i)" "$i" + ln -s "$CURDIR/$(basename $i)" "$i" else echo "$i" already overriden fi