代码拉取完成,页面将自动刷新
同步操作将从 空空。/aria2desktop 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
#export ELECTRON_MIRROR=https://npm.taobao.org/mirrors/electron/
ARIA2_RES=./res/aria2
ARIA2_VERSION=1.33.1
# build win x64
# build win ia32
# build mac x64
# build linux x64
# build linux ia32
build () {
clean
PLATFORM=$1
ARCH=$2
ARIC2_CLI="${ARIA2_RES}/aria2-${ARIA2_VERSION}-${PLATFORM}-${ARCH}/aria2c"
if [[ x"win" == x"$PLATFORM" ]];then
ARIC2_CLI="${ARIC2_CLI}.exe"
fi
if [[ ! -d "node_modules" ]];then
npm i
fi
if [[ ! -d "build" ]];then
npm run build
fi
if [[ x"$(which electron-builder)" == x"" ]]; then
npm i -g electron-builder
fi
cp $ARIC2_CLI ./build/aria2cli/
cp ./public/package.json ./build/package.json
electron-builder --project ./build --${PLATFORM} --${ARCH}
}
clean(){
[[ -f "./build/aria2cli/aria2c.exe" ]] && rm ./build/aria2cli/aria2c.exe
[[ -f "./build/aria2cli/aria2c" ]] && rm ./build/aria2cli/aria2c
}
case $1 in all)
build mac x64
build win x64
#build win ia32
build linux x64
;;
asar-test)
if [[ ! -f "app.asar" ]]; then
npm run build
ARIC2_CLI="${ARIA2_RES}/aria2-${ARIA2_VERSION}-$2-x64/aria2c"
cp ${ARIC2_CLI} ./build/aria2cli/aria2c
if [[ x"$(which asar)" == x"" ]];then
npm i -g asar
fi
asar pack build app.asar
fi
./node_modules/.bin/electron app.asar
;;
win|mac|linux)
arch=$2
if [[ x"" == x"$arch" ]]; then
arch=x64
fi
build $1 ${arch}
;;
*)
echo "错误的参数"
echo "请使用使用以下命令"
echo "$0 win|mac|linux x64|ia32"
echo "$0 asar-test win|mac|linux"
echo
;;
esac
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。