mirror of
https://github.com/openhwgroup/cvw
synced 2025-01-23 21:14:37 +00:00
Update sourcing of secondary scripts to work when called from any directory
This commit is contained in:
parent
2a78a65f69
commit
b6ad0571ac
@ -38,7 +38,8 @@ ENDC='\033[0m'
|
||||
|
||||
# If run standalone, determine distro information. Otherwise, use info from main install script
|
||||
if [ -z "$FAMILY" ]; then
|
||||
source wally-distro-check.sh
|
||||
dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "${dir}"/wally-distro-check.sh
|
||||
fi
|
||||
|
||||
# Generate list of packages to install, determined based on distro
|
||||
|
@ -36,6 +36,7 @@ NUM_THREADS=8 # for >= 32GiB
|
||||
#NUM_THREADS=16 # for >= 64GiB
|
||||
|
||||
set -e # break on error
|
||||
dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
# Colors
|
||||
BOLD='\033[1m'
|
||||
@ -48,7 +49,7 @@ FAIL_COLOR='\033[91m'
|
||||
ENDC='\033[0m'
|
||||
|
||||
# Get Linux distro and version
|
||||
source wally-distro-check.sh
|
||||
source "${dir}"/wally-distro-check.sh
|
||||
|
||||
# Check if root
|
||||
ROOT=$( [ "${EUID:=$(id -u)}" = 0 ] && echo true || echo false);
|
||||
@ -70,9 +71,9 @@ echo "Installation path: $RISCV"
|
||||
|
||||
# Install/update packages if root. Otherwise, check that packages are already installed.
|
||||
if [ "$ROOT" = true ]; then
|
||||
source wally-package-install.sh
|
||||
source "${dir}"/wally-package-install.sh
|
||||
else
|
||||
source wally-package-install.sh --check
|
||||
source "${dir}"/wally-package-install.sh --check
|
||||
fi
|
||||
|
||||
if [ "$FAMILY" = rhel ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user