Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.

Commit b91eda0

Browse files
committed
feat: Update scripts and move build to separate dir
1 parent b718302 commit b91eda0

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
cache/
22
data/
3+
/build/*
4+
!/build/PKGBUILD
5+
venv/

build renamed to build.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
set -eo pipefail
23

34
SHELL_FOLDER=$(dirname $(readlink -f "$0"))
45

@@ -11,13 +12,6 @@ find_downloader(){
1112
# 寻找下载器
1213
# 会设置 $downloader 和 $down_out_op 变量
1314

14-
# 寻找 aria2c
15-
if type aria2c >/dev/null 2>&1; then
16-
downloader=aria2c
17-
down_out_op=-o
18-
return
19-
fi
20-
2115
# 寻找 wget
2216
if type wget >/dev/null 2>&1; then
2317
downloader=wget
@@ -32,6 +26,15 @@ find_downloader(){
3226
return
3327
fi
3428

29+
# 寻找 aria2c
30+
# Preferring aria2 causes "address already in use" when there is existing aria2 instance
31+
# So move it to the end of the searching list
32+
if type aria2c >/dev/null 2>&1; then
33+
downloader=aria2c
34+
down_out_op=-o
35+
return
36+
fi
37+
3538
echo "未找到合适的下载器,请安装 aria2c/wget/curl 之一后重试。" >&2
3639
}
3740

@@ -162,4 +165,3 @@ cp ../cache/rime-symbols/opencc/* opencc
162165
echo 开始构建部署二进制
163166
rime_deployer --compile clover.schema.yaml . /usr/share/rime-data || exit
164167
rm -rf build/*.txt
165-
File renamed without changes.

pack renamed to pack.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
set -euo pipefail
23

34
ver="$1"
45

@@ -7,4 +8,4 @@ rm -rf clover.schema-$ver.zip
78
rm -rf clover.schema-build-$ver.zip
89
zip -5 clover.schema-$ver.zip *.yaml opencc/*
910
zip -5 clover.schema-build-$ver.zip *.yaml opencc/* build/*
10-
11+
cp clover.schema-build-$ver.zip ../build

0 commit comments

Comments
 (0)