优化Linux平台批量打包程序
This commit is contained in:
2
app.csv
2
app.csv
@@ -1,4 +1,4 @@
|
|||||||
weread,微信阅读,weread.qq.com
|
weread,微信阅读,weread.qq.com
|
||||||
aliyuque,语雀,www.yuque.com
|
aliyuque,语雀,www.yuque.com
|
||||||
flomo,浮墨,flomoapp.com
|
flomo,浮墨,flomoapp.com
|
||||||
weread,微信阅读,weread.qq.com
|
weread,微信阅读,weread.qq.com
|
||||||
|
|||||||
|
70
build.sh
70
build.sh
@@ -4,17 +4,30 @@ if [ ! -d "node_modules" ]; then
|
|||||||
npm i
|
npm i
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 依次填入app名称,链接
|
|
||||||
# Fill in the app name and link in turn
|
if [ ! -d "output" ]; then
|
||||||
app_list=(
|
mkdir output
|
||||||
"weread 微信阅读 weread.qq.com"
|
fi
|
||||||
"aliyuque 语雀 www.yuque.com"
|
|
||||||
"flomo 浮墨 flomoapp.com"
|
if [[ "$OSTYPE" =~ ^linux ]]; then
|
||||||
"weread 微信阅读 weread.qq.com"
|
if [ ! -d "output/linux" ]; then
|
||||||
)
|
mkdir output/linux
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [[ "$OSTYPE" =~ ^darwin ]]; then
|
||||||
|
if [ ! -d "output/macos" ]; then
|
||||||
|
mkdir output/macos
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# total package number
|
# total package number
|
||||||
|
export total=`sed -n '$=' app.csv`
|
||||||
export index=1
|
export index=1
|
||||||
export total=4
|
|
||||||
|
|
||||||
old_name="weread"
|
old_name="weread"
|
||||||
old_zh_name="微信阅读"
|
old_zh_name="微信阅读"
|
||||||
@@ -37,26 +50,31 @@ if [[ "$OSTYPE" =~ ^darwin ]]; then
|
|||||||
echo "==============="
|
echo "==============="
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for app_info in "${app_list[@]}"; do
|
while read line
|
||||||
array=($app_info)
|
do
|
||||||
package_name=${array[0]}
|
package_name=$(echo ${line} | cut -d , -f 1)
|
||||||
package_zh_name=${array[1]}
|
package_zh_name=$(echo ${line} | cut -d , -f 2)
|
||||||
url=${array[2]}
|
url=$(echo ${line} | cut -d , -f 3)
|
||||||
echo "update package name and url"
|
echo "update package name and url"
|
||||||
# replace package info
|
# replace package info
|
||||||
|
|
||||||
if [[ "$OSTYPE" =~ ^linux ]]; then
|
if [[ "$OSTYPE" =~ ^linux ]]; then
|
||||||
sed -i "s/${old_url}/${url}/g" src-tauri/tauri.conf.json
|
sed -i "s/${old_url}/${url}/g" src-tauri/tauri.conf.json
|
||||||
sed -i "s/${old_name}/${package_name}/g" src-tauri/tauri.conf.json
|
sed -i "s/${old_name}/${package_name}/g" src-tauri/tauri.conf.json
|
||||||
|
echo "update ico with 32x32 pictue"
|
||||||
|
sed -i "s/${old_name}/${package_name}/g" src-tauri/src/main.rs
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$OSTYPE" =~ ^darwin ]]; then
|
if [[ "$OSTYPE" =~ ^darwin ]]; then
|
||||||
sed -i '' "s|${old_url}|${url}|g" src-tauri/tauri.conf.json
|
sed -i '' "s|${old_url}|${url}|g" src-tauri/tauri.conf.json
|
||||||
sed -i '' "s|${old_name}|${package_name}|g" src-tauri/tauri.conf.json
|
sed -i '' "s|${old_name}|${package_name}|g" src-tauri/tauri.conf.json
|
||||||
|
echo "update ico with 32x32 pictue"
|
||||||
|
sed -i "s|${old_name}|${package_name}|g" src-tauri/src/main.rs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "update ico with 32x32 pictue"
|
# echo "update ico with 32x32 pictue"
|
||||||
cp "src-tauri/png/${package_name}_32.ico" "src-tauri/icons/icon.ico"
|
# cp "src-tauri/png/${package_name}_32.ico" "src-tauri/icons/icon.ico"
|
||||||
|
|
||||||
if [[ "$OSTYPE" =~ ^linux ]]; then
|
if [[ "$OSTYPE" =~ ^linux ]]; then
|
||||||
echo "update desktop"
|
echo "update desktop"
|
||||||
@@ -77,4 +95,22 @@ for app_info in "${app_list[@]}"; do
|
|||||||
npm run tauri build
|
npm run tauri build
|
||||||
echo "package build success!"
|
echo "package build success!"
|
||||||
index=$(($index+1))
|
index=$(($index+1))
|
||||||
done
|
|
||||||
|
if [[ "$OSTYPE" =~ ^linux ]]; then
|
||||||
|
mv src-tauri/target/release/bundle/deb/*.deb output/linux
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$OSTYPE" =~ ^darwin ]]; then
|
||||||
|
# mv src-tauri/target/release/bundle/deb/*.deb output/linux
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
done < app.csv
|
||||||
|
|
||||||
|
echo "build all package success!"
|
||||||
|
if [[ "$OSTYPE" =~ ^linux ]]; then
|
||||||
|
echo "result file in output/linux"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$OSTYPE" =~ ^darwin ]]; then
|
||||||
|
echo "result file in output/macos"
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user