forked from EnviroMine/EnviroMine-1.7
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_wiki
25 lines (17 loc) · 858 Bytes
/
update_wiki
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
mkdir -p ./wiki
cd ./wiki
# Clone wiki
git clone [email protected]:Funwayguy/EnviroMine.wiki.git ./
#Replace old build with new one
grep -lR -e "<${build_text}>.*</${build_text}>" * | xargs sed -i "s/<${build_text}>.*<\/${build_text}>/<${build_text}>$ver_num<\/${build_text}>/g"
#Replace old date with new one
grep -lR -e "<${date_text}>.*</${date_text}>" * | xargs sed -i "s/<${date_text}>.*<\/${date_text}>/<${date_text}>${cur_date}<\/${date_text}>/g"
#Replace old download link with new one
grep -lR -e "\[downloads\-1\.7\]:.*" * | xargs sed -i "s/\[downloads\-1\.7\]:.*/\[downloads\-1\.7\]: ${download_link}/g"
#Replace old build link with new one
grep -lR -e "\[build\-1\.7\]:.*" * | xargs sed -i "s/\[build\-1\.7\]:.*/\[build\-1\.7\]: ${build_link}/g"
#Commit the new page
git add .
git commit -m "Updated version"
git push -u origin master
cd ../