summaryrefslogtreecommitdiff
path: root/binary.sh
diff options
context:
space:
mode:
authorGubolin <gubolin@fantasymail.de>2015-07-23 14:28:31 +0200
committerGubolin <gubolin@fantasymail.de>2015-07-23 14:28:31 +0200
commit29b5dba84e8f3aa95a3b9296d5a01a2609f4590d (patch)
tree4ec090b68a695c6ba6d7bc26b6362519b485a0ba /binary.sh
parent526a595c5e00f171eb814f063e58a6c18c5784d4 (diff)
parent5aec52889d79a8257971095719195fabcbc33559 (diff)
downloadsnap-gh-pages.tar.gz
snap-gh-pages.zip
merge developmentgh-pages
Diffstat (limited to 'binary.sh')
-rwxr-xr-xbinary.sh27
1 files changed, 14 insertions, 13 deletions
diff --git a/binary.sh b/binary.sh
index 9de5fa0..809d1fe 100755
--- a/binary.sh
+++ b/binary.sh
@@ -18,6 +18,8 @@ then
echo " Desktop win32 win64 osx linux32 linux64"
echo ""
echo "If FILE/URL is given, it will be #open-ed inside Snap! immediately. URL will be loaded at runtime."
+ echo "If URL starts with a hash ('#'), it will be used as initial base url suffix"
+ echo " (for example '#present:UserName=foo\&ProjectName=bar', escape the '&')."
echo ""
echo ""
echo "The following environment variables will be used, if available:"
@@ -49,18 +51,12 @@ git clone $snapsource $buildsource
cd "$buildsource"
git checkout mobileapp
-rm -rf .git/
-
if [ $ide == false ]
then
# minimize everything
- rm lang* ypr.js paint.js cloud.js gui.js *.sh *.pdf *.txt
+ rm *.sh *.pdf *.txt
rm -r help/ Costumes/ Backgrounds/ Sounds/
- sed -i '/paint\.js"/d' snap.html
- sed -i '/cloud\.js"/d' snap.html
- sed -i 's/gui\.js"/binary\.js"/' snap.html
-
# if a file was given, move it to "project.xml"
# it will be loaded like an URL then
if [ -f "$3" ]
@@ -71,12 +67,17 @@ then
url=$3
fi
- # load custom project from url
- sed -i "/ide\.openIn/a\
- ide.droppedText(ide.getURL('$url')); " snap.html
-
-else
- rm binary.js
+ if [[ $url == \#* ]]
+ then
+ # load custom project from cloud or string
+ sed -i "s/snap.html/snap.html${url}/g" config.xml package.json
+ else
+ # load custom project from url
+ sed -i "/ide\.openIn/a\
+ ide.droppedText(ide.getURL('$url'));" snap.html
+ sed -i "/this.toggleAppMode(false)/d" gui.js
+ sed -i "s/snap.html/snap.html#run:/g" config.xml package.json
+ fi
fi
# compress all js files