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
This commit is contained in:
Victor Westerlund 2025-08-07 12:22:52 +02:00
parent 366939068a
commit 8b80663a32

View file

@ -49,12 +49,15 @@ install_reflect() {
exit 1 exit 1
fi fi
# Download and install the Reflect repository
if [[ "$install" != "n" ]]; then
if ! [ -d "reflect" ] ; then if ! [ -d "reflect" ] ; then
git submodule add https://codeberg.org/reflect/reflect git submodule add https://codeberg.org/reflect/reflect
fi fi
# Update submodules # Update submodules
git submodule update --init --recursive git submodule update --init --recursive
fi
# Install dependencies with composer # Install dependencies with composer
(cd reflect && composer install --classmap-authoritative) (cd reflect && composer install --classmap-authoritative)
@ -62,8 +65,15 @@ install_reflect() {
# Bail out if composer didn't create a vendor folder # Bail out if composer didn't create a vendor folder
if ! [ -d "reflect/vendor" ] ; then if ! [ -d "reflect/vendor" ] ; then
echo_err "Something went wrong with the installation." echo_err "Something went wrong with the installation."
# Script was not run with the install flag disabled, this is probably a bug
if [[ "$install" != "n" ]]; then
exit_report exit_report
fi fi
echo_err "Make sure you have cloned the Reflect repository. Or run without '--install=n'."
exit 1
fi
} }
configure_reflect() { configure_reflect() {
@ -200,11 +210,7 @@ main() {
check_sys_depend check_sys_depend
# Download and install the Reflect repository
if [[ "$install" != "n" ]]; then
install_reflect install_reflect
fi
configure_reflect configure_reflect
echo echo