feat: 增加 Node.js 版本

This commit is contained in:
zhengkunwang223
2023-10-06 21:25:35 +08:00
parent 7a9e7cea7f
commit ab48604144
9 changed files with 153 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/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