mirror of
https://github.com/QYG2297248353/appstore-1panel.git
synced 2024-12-01 17:32:25 +08:00
36 lines
714 B
Bash
36 lines
714 B
Bash
|
#!/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
|
||
|
|
||
|
|
||
|
|
||
|
|