Skip to content

Commit

Permalink
Run yarn/npm install if data path has package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
back-2-95 committed Jul 28, 2023
1 parent 627c596 commit 212746b
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,28 @@

set -e

echo "Update caniuse-lite..."
echo -e "[DONN] Update caniuse-lite...\n"
npx -yq update-browserslist-db@latest

if [ $1 == "gulp" ]; then
if [ -f "$DATA_PATH/package.json" ]; then

cd ${GULP_PATH}
if [ -f "$DATA_PATH/yarn.lock" ]; then

echo -e "\n[DONN] yarn.lock exists, running yarn install...\n"
yarn --cwd "${DATA_PATH}" install --frozen-lockfile

else

echo -e "\n[DONN] Running npm install...\n"
npm --prefix "${DATA_PATH}" --no-audit --no-fund --engine-strict true install
fi

fi

if [ "$1" == "gulp" ]; then

echo -e "\n[DONN] Running Gulp...\n"
cd "${GULP_PATH}"
exec "$@"

else
Expand Down

0 comments on commit 212746b

Please sign in to comment.