Skip to content

Commit

Permalink
run npm stuff on bootup only if node_modules does not exist
Browse files Browse the repository at this point in the history
Accepting #4 and preventing `npm` running each and every time on Container start.
  • Loading branch information
macwinnie authored Feb 11, 2024
1 parent 68c8ed2 commit cdbbbe9
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions files/motiontool_boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@ cd "${APACHE_WORKDIR}"

chown -R "${WORKINGUSER}" "${APACHE_WORKDIR}"

sudo -u "${WORKINGUSER}" composer install --prefer-dist
sudo -u "${WORKINGUSER}" npm install
sudo -u "${WORKINGUSER}" npm run build
# sudo -u "${WORKINGUSER}" gulp
# only run `composer install` if `vendor` not present
if [ ! -d "./vendor" ]; then
sudo -u "${WORKINGUSER}" composer install --prefer-dist
fi

# only run `npm` stuff if `node_modules` are not present
if [ ! -d "./node_modules" ]; then
sudo -u "${WORKINGUSER}" npm install
sudo -u "${WORKINGUSER}" npm run build
# sudo -u "${WORKINGUSER}" gulp
fi

if [ -s "${APACHE_WORKDIR}/config/config.json" ]; then

Expand Down

0 comments on commit cdbbbe9

Please sign in to comment.