Skip to content

Commit 767207b

Browse files
committed
Use internal composer installer script when installing filemanager
1 parent e0f54cb commit 767207b

File tree

1 file changed

+5
-22
lines changed

1 file changed

+5
-22
lines changed

install/deb/filemanager/install-fm.sh

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,13 @@ FM_FILE="filegator_v${FM_V}.zip"
2525
FM_URL="https://github.com/filegator/filegator/releases/download/v${FM_V}/${FM_FILE}"
2626

2727

28-
COMPOSER_DIR="$HOMEDIR/$user/.composer"
29-
COMPOSER_BIN="$COMPOSER_DIR/composer"
30-
28+
COMPOSER_BIN="$HOMEDIR/$user/.composer/composer"
3129
if [ ! -f "$COMPOSER_BIN" ]; then
32-
mkdir -p "$COMPOSER_DIR"
33-
chown $user: "$COMPOSER_DIR"
34-
35-
COMPOSER_SETUP_FILE=$(mktemp)
36-
check_result $? "Create temp file"
37-
chown $user: "$COMPOSER_SETUP_FILE"
38-
39-
signature="$(curl --silent --show-error https://composer.github.io/installer.sig)"
40-
check_result $? "Download signature"
41-
42-
user_exec wget --tries=3 --timeout=15 --read-timeout=15 --waitretry=3 --no-dns-cache https://getcomposer.org/installer --quiet -O "$COMPOSER_SETUP_FILE"
43-
check_result $? "Download composer installer"
44-
45-
[[ "$signature" = $(sha384sum $COMPOSER_SETUP_FILE | cut -f 1 -d " ") ]] || check_result $E_INVALID "Composer signature does not match"
46-
47-
COMPOSER_HOME="$HOMEDIR/$user/.config/composer" user_exec /usr/bin/php "$COMPOSER_SETUP_FILE" --quiet --install-dir="$COMPOSER_DIR" --filename=composer
48-
check_result $? "Composer install failed"
49-
50-
[ -f "$COMPOSER_SETUP_FILE" ] && rm -f "$COMPOSER_SETUP_FILE"
30+
$BIN/v-add-user-composer "$user"
31+
check_result $? "Install composer failed"
5132
fi
5233

34+
rm --recursive --force "$FM_INSTALL_DIR"
5335
mkdir -p "$FM_INSTALL_DIR"
5436
cd "$FM_INSTALL_DIR"
5537

@@ -59,6 +41,7 @@ cd "$FM_INSTALL_DIR"
5941
unzip -qq "${FM_INSTALL_DIR}/${FM_FILE}"
6042
mv --force ${FM_INSTALL_DIR}/filegator/* "${FM_INSTALL_DIR}"
6143
rm --recursive --force ${FM_INSTALL_DIR}/filegator
44+
[[ -f "${FM_INSTALL_DIR}/${FM_FILE}" ]] && rm "${FM_INSTALL_DIR}/${FM_FILE}"
6245

6346
cp --recursive --force ${HESTIA_INSTALL_DIR}/filemanager/filegator/* "${FM_INSTALL_DIR}"
6447

0 commit comments

Comments
 (0)