appstore-1panel/apps/node/14.21.3/run.sh

28 lines
637 B
Bash
Raw Normal View History

2023-10-06 21:25:26 +08:00
#!/bin/bash
source /.env
if [[ "$PACKAGE_MANAGER" == "npm" ]]; then
npm config set registry $CONTAINER_PACKAGE_URL
elif [[ "$PACKAGE_MANAGER" == "yarn" ]]; then
yarn config set registry $CONTAINER_PACKAGE_URL
fi
if [[ "$RUN_INSTALL" -eq "1" ]]; then
if [[ "$PACKAGE_MANAGER" == "npm" ]]; then
npm install
elif [[ "$PACKAGE_MANAGER" == "yarn" ]]; then
yarn install
else
echo "未知的 PACKAGE_MANAGER: $PACKAGE_MANAGER"
exit 1
fi
fi
if [[ "$PACKAGE_MANAGER" == "npm" ]]; then
npm run $EXEC_SCRIPT
elif [[ "$PACKAGE_MANAGER" == "yarn" ]]; then
yarn run $EXEC_SCRIPT
fi