-
Notifications
You must be signed in to change notification settings - Fork 10
/
release.sh
42 lines (30 loc) · 1.13 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
# 文件来源于https://github.com/UB-Mannheim/zotero-ocr/blob/master/release.sh
# 和https://github.com/UB-Mannheim/zotero-ocr/blob/master/build.sh
read -p "Enter new version number: " version
##############
## Update install.rdf
##############
perl -pi -e "s/em:version=\"[^\"]*/em:version=\"$version/;" "install.rdf"
# rm "install.rdf.bak"
# git add "install.rdf"
##############
## Update update.rdf
##############
perl -pi -e "s/<em:version>[^<]*/<em:version>$version/;" \
-e "s/<em:updateLink>[^<]*/<em:updateLink>https:\/\/github.com\/redleafnew\/zotero-updateifs\/releases\/download\/$version\/zotero-updateifs.xpi/;" \
-e "s/<em:updateInfoURL>[^<]*/<em:updateInfoURL>https:\/\/github.com\/redleafnew\/zotero-updateifs\/releases\/tag\/$version/;" \
update.rdf
# git add "update.rdf"
# rm "update.rdf.bak"
# git commit -m "Release $version" 1>&2
##############
## 生成xpi
##############
#./build.sh "$version"
#version="$1"
#if [ -z "$version" ]; then
# read -p "Enter new version number: " version
#fi
rm -f zotero-updateifs.xpi
zip -r zotero-updateifs.xpi chrome/* defaults/* chrome.manifest install.rdf