From 8b80663a32395044de2120e96c07ff11588a4cff Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Thu, 7 Aug 2025 12:22:52 +0200 Subject: [PATCH] fix: install composer packages even though `--install=n` is passed (#4) Composer packages should still be installed even if the `--install=n` flag is set. The only thing "--install=n" won't do is download and add git submodules Reviewed-on: https://codeberg.org/reflect/install/pulls/4 --- install.sh | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/install.sh b/install.sh index 1d449e6..60e1c7d 100755 --- a/install.sh +++ b/install.sh @@ -49,12 +49,15 @@ install_reflect() { exit 1 fi - if ! [ -d "reflect" ] ; then - git submodule add https://codeberg.org/reflect/reflect - fi + # Download and install the Reflect repository + if [[ "$install" != "n" ]]; then + if ! [ -d "reflect" ] ; then + git submodule add https://codeberg.org/reflect/reflect + fi - # Update submodules - git submodule update --init --recursive + # Update submodules + git submodule update --init --recursive + fi # Install dependencies with composer (cd reflect && composer install --classmap-authoritative) @@ -62,7 +65,14 @@ install_reflect() { # Bail out if composer didn't create a vendor folder if ! [ -d "reflect/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 Reflect repository. Or run without '--install=n'." + exit 1 fi } @@ -200,11 +210,7 @@ main() { check_sys_depend - # Download and install the Reflect repository - if [[ "$install" != "n" ]]; then - install_reflect - fi - + install_reflect configure_reflect echo