diff --git a/scripts/_common.sh b/scripts/_common.sh index d840d11..530e469 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -91,6 +91,6 @@ init_composer() { cp "${DESTDIR}/composer.json-dist" "${DESTDIR}/composer.json" # update dependencies to create composer.lock - exec_composer "$AS_USER" "$DESTDIR" update --no-dev \ + exec_composer "$AS_USER" "$DESTDIR" install --no-dev \ || die "Unable to update Roundcube core dependencies" } diff --git a/scripts/upgrade b/scripts/upgrade index 333c422..13b4aa0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -29,6 +29,15 @@ DESTDIR="/var/www/$app" TMPDIR=$(ynh_mkdir_tmp) extract_roundcube "$TMPDIR" +# Check if composer is already used +if [[ -f ${DESTDIR}/composer.json ]]; then + # FIXME: Keep the installed roundcube plugin-installer and so installed.json + # composer file since 0.1.7 shipped version is buggy + cp -a "${DESTDIR}/vendor/composer/installed.json" "${TMPDIR}/vendor/composer" + cp -a "${DESTDIR}/vendor/roundcube/plugin-installer" \ + "${TMPDIR}/vendor/roundcube" +fi + # Install the new Roundcube version sudo php "${TMPDIR}/bin/installto.sh" "$DESTDIR" --force --accept \ || die "Unable to update Roundcube installation"