From 6814714f26dff6dfbad02c4908acdd58cfee6dd0 Mon Sep 17 00:00:00 2001 From: Bob Mottram <bob@freedombone.net> Date: Sat, 13 Oct 2018 19:07:12 +0100 Subject: [PATCH] Install npm and yarn --- src/freedombone-app-peertube | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/freedombone-app-peertube b/src/freedombone-app-peertube index d937c7ff5..938c12e6e 100755 --- a/src/freedombone-app-peertube +++ b/src/freedombone-app-peertube @@ -97,7 +97,19 @@ function install_peertube_base { cd ${PEERTUBE_DIR}/peertube-latest || exit 35685 chown -R peertube:peertube $PEERTUBE_DIR - sudo -H -u peertube npm install + sudo -H -u peertube npm install npm@5.8.0 + sudo -H -u peertube npm install yarn@1.10.1 + + if [ ! -f "${PEERTUBE_DIR}/.bashrc" ]; then + echo "PATH=${PEERTUBE_DIR}/peertube-latest/node_modules/yarn/bin:${PEERTUBE_DIR}/peertube-latest/node_modules/npm/bin:\$PATH" > "${PEERTUBE_DIR}/.bashrc" + else + if ! grep -q "PATH=${PEERTUBE_DIR}" "${PEERTUBE_DIR}/.bashrc"; then + echo "PATH=${PEERTUBE_DIR}/peertube-latest/node_modules/yarn/bin:${PEERTUBE_DIR}/peertube-latest/node_modules/npm/bin:\$PATH" >> "${PEERTUBE_DIR}/.bashrc" + fi + fi + chown peertube:peertube "${PEERTUBE_DIR}/.bashrc" + + sudo -H -u peertube NPM_CONFIG_PREFIX=${PEERTUBE_DIR}/peertube-latest/node_modules/npm NODE_CONFIG_DIR=${PEERTUBE_DIR}/config yarn install --production --pure-lockfile peertube_tcp_tuning } @@ -1095,7 +1107,7 @@ function install_peertube { fi groupadd peertube - useradd -c "PeerTube system account" -d $PEERTUBE_DIR -m -r -g peertube peertube + useradd -c "PeerTube system account" -d $PEERTUBE_DIR -m -r -g peertube -s /bin/bash peertube peertube_create_database @@ -1133,8 +1145,12 @@ function install_peertube { peertube_import_from_syncthing + cd $PEERTUBE_DIR/peertube-latest || exit 23468724 + NODE_CONFIG_DIR=$PEERTUBE_DIR/config NODE_ENV=production npm run reset-password -- -u root + set_completion_param "peertube version" "$PEERTUBE_VERSION" set_completion_param "peertube domain" "$PEERTUBE_DOMAIN_NAME" + APP_INSTALLED=1 } -- GitLab