forked from PagerDuty/pdjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·31 lines (25 loc) · 903 Bytes
/
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
#!/bin/bash
#This is a script to push the resulting js to http://eurica.github.io/pdjs/pdjs.js
releasedir=../pdjsgh
echo Last version number:
cat version
[ "$#" -eq 1 ] || { echo " Please enter a version number" >&2; exit 1; }
version=$1
echo Creating version ${version}
echo ${version} > version
# This is the ugliest sed ever, someday I'll fix it.
sed -i '' -E 's/version *= *"PDJS-[0-9.]+"/version = "PDJS-VERSIONNUMBER"/g' coffee/pdjsbase.coffee
sed -E -i '' s/VERSIONNUMBER/${version}/g coffee/pdjsbase.coffee
cp coffee/* ${releasedir}/coffee/
# prepare a release
coffee --output ${releasedir}/ --compile --join pdjs.js coffee/
cp README.* ${releasedir}/
cp examples/* ${releasedir}/examples/
cwd=$(pwd)
cd ${releasedir}/
cp pdjs.js js/pdjs-${version}.js
cp pdjs.js js/pdjs.js
git add .
git commit -m "preparing version ${version} for github pages"
git push origin gh-pages --force
cd ${cwd}