From e173aaaff3c967366fbfd2ca88c94658ce2d9d1a Mon Sep 17 00:00:00 2001 From: Gubolin Date: Sat, 10 Jan 2015 11:55:48 +0100 Subject: update binary.sh help --- binary.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'binary.sh') diff --git a/binary.sh b/binary.sh index 212e7cb..aad0439 100755 --- a/binary.sh +++ b/binary.sh @@ -15,7 +15,7 @@ then echo "" echo "PLATFORMS:" echo " Mobile amazon-fireos android blackberry10 firefoxos ios ubuntu wp8 win8 tizen" - echo " Desktop win osx linux32 linux64" + echo " Desktop win32 win64 osx linux32 linux64" echo "" echo "If FILE is given, it will be #open-ed inside Snap\! immediately" exit 0 -- cgit v1.3.1 From abd2808e3ec474c3c72e22d3cea7e98a941521e8 Mon Sep 17 00:00:00 2001 From: Gubolin Date: Sat, 24 Jan 2015 09:08:25 +0100 Subject: don't include help files in binary projects --- binary.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'binary.sh') diff --git a/binary.sh b/binary.sh index 212e7cb..72c1ca2 100755 --- a/binary.sh +++ b/binary.sh @@ -57,6 +57,7 @@ if [ $ide == false ] then # minimize everything rm lang* ypr.js paint.js cloud.js gui.js + rm -r help/ sed -i '/paint\.js"/d' snap.html sed -i '/cloud\.js"/d' snap.html -- cgit v1.3.1 From 3960ec456021910ead8f4e65e59d4e764442822b Mon Sep 17 00:00:00 2001 From: Gubolin Date: Sat, 24 Jan 2015 10:04:34 +0100 Subject: add the possibility to load binary projects dynamically --- binary.sh | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'binary.sh') diff --git a/binary.sh b/binary.sh index 72c1ca2..259dd3a 100755 --- a/binary.sh +++ b/binary.sh @@ -7,7 +7,7 @@ fi if [[ $# < 2 ]] then - echo "Usage: binary.sh OPTION PLATFORM [FILE]" + echo "Usage: binary.sh OPTION PLATFORM [FILE/URL]" echo "" echo "OPTIONS:" echo " -m Mobile" @@ -17,7 +17,7 @@ then echo " Mobile amazon-fireos android blackberry10 firefoxos ios ubuntu wp8 win8 tizen" echo " Desktop win osx linux32 linux64" echo "" - echo "If FILE is given, it will be #open-ed inside Snap\! immediately" + echo "If FILE/URL is given, it will be #open-ed inside Snap\! immediately. URL will be loaded at runtime." exit 0 fi @@ -28,6 +28,7 @@ scriptdir=$(readlink -e ".") # UglifyJS2 (https://github.com/mishoo/UglifyJS2) ide=true +url=false platform=$2 # presentation mode @@ -40,9 +41,9 @@ if [ $ide == false ] then if [ -f "$3" ] then - content=$(cat $3) + content="'$(cat $3)'" else - ide=true + url=true fi fi @@ -63,16 +64,23 @@ then sed -i '/cloud\.js"/d' snap.html sed -i 's/gui\.js"/binary\.js"/' snap.html - # load custom project from file - sed -i '/sha512\.js"/a\ - ' snap.html + # load custom project from file or url + if [ $url == false ] + then + sed -i '/sha512\.js"/a\ + ' snap.html + + echo "var code =" > code.js + echo "$content" >> code.js + echo ";" >> code.js - echo "var code =" > code.js - echo "'$content'" >> code.js - echo ";" >> code.js + sed -i "/ide\.openIn/a\ + ide.droppedText(code); " snap.html + else + sed -i "/ide\.openIn/a\ + ide.droppedText(ide.getURL('$3')); " snap.html + fi - sed -i "/ide\.openIn/a\ - ide.droppedText(code); " snap.html else rm binary.js fi -- cgit v1.3.1