diff --git a/install.sh b/install.sh index 9cb152a..a1a106b 100755 --- a/install.sh +++ b/install.sh @@ -41,12 +41,15 @@ install_vegvisir() { exit 1 fi - if ! [ -d "vegvisir" ] ; then - git submodule add https://codeberg.org/vegvisir/vegvisir - fi + # Download and install the Vegvisir repository + if [[ "$install" != "n" ]]; then + if ! [ -d "vegvisir" ] ; then + git submodule add https://codeberg.org/vegvisir/vegvisir + fi - # Update submodules - git submodule update --init --recursive + # Update submodules + git submodule update --init --recursive + fi # Install dependencies with composer (cd vegvisir && composer install --classmap-authoritative) @@ -54,7 +57,14 @@ install_vegvisir() { # Bail out if composer didn't create a vendor folder if ! [ -d "vegvisir/vendor" ] ; then echo_err "Something went wrong with the installation." - exit_report + + # Script was not run with the install flag disabled, this is probably a bug + if [[ "$install" != "n" ]]; then + exit_report + fi + + echo_err "Make sure you have cloned the Vegvisir repository. Or run without '--install=n'." + exit 1 fi } @@ -65,12 +75,14 @@ configure_vegvisir() { fi # A configuration file already exists - if [[ -f "vegvisir/.env.ini" && "$overwrite" != "y" ]] ; then - echo "A Vegvisir configuration file already exists at: ${cwd}/vegvisir/.env.ini" - read -p "Do you want to overwrite this file? (y/n): " choice