111
This commit is contained in:
parent
8f13c1231a
commit
6f9cd2d21a
4
index.js
4
index.js
@ -16,6 +16,10 @@ let apiEndpoint = 'https://oss.x-php.com/alist/link';
|
|||||||
|
|
||||||
// 解析命令行参数
|
// 解析命令行参数
|
||||||
args.forEach(arg => {
|
args.forEach(arg => {
|
||||||
|
// 去掉--
|
||||||
|
if (arg.startsWith('--')) {
|
||||||
|
arg = arg.substring(2);
|
||||||
|
}
|
||||||
const [key, value] = arg.split('=');
|
const [key, value] = arg.split('=');
|
||||||
if (key === 'port') {
|
if (key === 'port') {
|
||||||
port = parseInt(value, 10);
|
port = parseInt(value, 10);
|
||||||
|
2
index.sh
2
index.sh
@ -40,7 +40,7 @@ curl -o $FILE https://x-mo.cn:9009/XiaoMo/alist-proxy/raw/branch/master/index.js
|
|||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "下载完成,正在执行 $FILE..."
|
echo "下载完成,正在执行 $FILE..."
|
||||||
node $FILE port=$PORT # 传递端口作为参数
|
node $FILE --port=$PORT # 使用 --port=6001 传递参数
|
||||||
else
|
else
|
||||||
echo "下载失败"
|
echo "下载失败"
|
||||||
fi
|
fi
|
Loading…
x
Reference in New Issue
Block a user