瀏覽代碼

update setversion.sh

Manfred Kroehnert 11 年之前
父節點
當前提交
8fa5c9323a
共有 1 個文件被更改,包括 14 次插入10 次删除
  1. 14 10
      bin/setversion.sh

+ 14 - 10
bin/setversion.sh

@@ -1,17 +1,21 @@
 #!/bin/sh
-cd `dirname "$0"`
-cd ../st
-rm -f *.js
+
+VERSION=$1
+cd `dirname "$0"`/../
+AMBER_BASE=`pwd`
+
+cd $AMBER_BASE/st
+# replace version number
 cp Kernel-Infrastructure.st Kernel-Infrastructure.st.bak
-sed -e "/^version\$/,/^\! \!\$/ s/\^ '[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\(-pre\)\{0,1\}'\$/^ '$1'/" Kernel-Infrastructure.st.bak >Kernel-Infrastructure.st
+sed -e "/^version\$/,/^\! \!\$/ s/\^ '[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\(-pre\)\{0,1\}'\$/^ '$VERSION'/" Kernel-Infrastructure.st.bak >Kernel-Infrastructure.st
 rm Kernel-Infrastructure.st.bak
-cd ..
-bin/amberc -d -l Kernel-Objects,Kernel-Collections Kernel-Infrastructure.st
-cd st
-mv *.js ../js
-cd ..
+
+# compile Kernel-Infrastructure
+cd $AMBER_BASE
+bin/amberc -D js -l Kernel-Objects,Kernel-Collections st/Kernel-Infrastructure.st
+# set version in all json files (bower, npm)
 for F in *.json; do
   cp $F $F.bak
-  sed -e 's/"version": "[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\(-pre\)\{0,1\}"/"version": "'"$1"'"/' $F.bak >$F
+  sed -e 's/"version": "[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\(-pre\)\{0,1\}"/"version": "'"$VERSION"'"/' $F.bak >$F
   rm $F.bak
 done