This commit is contained in:
蒋小陌 2024-10-13 16:34:07 +08:00
parent 8f13c1231a
commit 6f9cd2d21a
2 changed files with 6 additions and 2 deletions

View File

@ -16,6 +16,10 @@ let apiEndpoint = 'https://oss.x-php.com/alist/link';
// 解析命令行参数
args.forEach(arg => {
// 去掉--
if (arg.startsWith('--')) {
arg = arg.substring(2);
}
const [key, value] = arg.split('=');
if (key === 'port') {
port = parseInt(value, 10);

View File

@ -40,7 +40,7 @@ curl -o $FILE https://x-mo.cn:9009/XiaoMo/alist-proxy/raw/branch/master/index.js
if [ $? -eq 0 ]; then
echo "下载完成,正在执行 $FILE..."
node $FILE port=$PORT # 传递端口作为参数
node $FILE --port=$PORT # 使用 --port=6001 传递参数
else
echo "下载失败"
fi