feat: Node.JS 新增 20.9.0 (LTS) 和 21.1.0 (Current) 版本

This commit is contained in:
zhengkunwang223
2023-10-31 15:38:28 +08:00
parent da2f1068fa
commit 19777c056d
6 changed files with 120 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
#!/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 [[ "$CUSTOM_SCRIPT" -eq "1" ]]; then
$EXEC_SCRIPT
else
if [[ "$PACKAGE_MANAGER" == "npm" ]]; then
npm run $EXEC_SCRIPT
elif [[ "$PACKAGE_MANAGER" == "yarn" ]]; then
yarn run $EXEC_SCRIPT
fi
fi