From d8fcd8a68d83a81dbe1b2a5ac89f4284aa991f57 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Thu, 7 Aug 2025 10:30:11 +0200 Subject: [PATCH] feat: add --dir flag and use --install=n as flag for config only --- install.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 08ade8e..9cb152a 100755 --- a/install.sh +++ b/install.sh @@ -2,6 +2,7 @@ # Initialize variables cwd="" +dir="" install="" example="" overwrite="" @@ -156,8 +157,12 @@ main() { # Get the current working directory cwd=$(pwd) - check_sys_depend - install_vegvisir + # Download and install the Vegvisir repository + if [[ "$install" != "n" ]]; then + check_sys_depend + install_vegvisir + fi + configure_vegvisir echo "Vegvisir has been sucessfully installed." @@ -178,6 +183,10 @@ main() { # Loop through all arguments for arg in "$@"; do case $arg in + --dir=*) + dir="${arg#*=}" + ;; + --install=*) install="${arg#*=}" ;; @@ -197,14 +206,14 @@ for arg in "$@"; do done # Start execution immediately if an install directory was passed -if [ -n "$install" ]; then - if ! [ -d "$install" ]; then - echo_err "Installation aborted: '$install' is not a directory" +if [ -n "$dir" ]; then + if ! [ -d "$dir" ]; then + echo_err "Installation aborted: '$dir' is not a directory" exit 1 fi # Move to install directory and run main - cd $install + cd $dir main fi