From fbb10834c62ca0712858ec4685b27f4ac1ef10ae Mon Sep 17 00:00:00 2001 From: Gubolin Date: Wed, 4 Mar 2015 18:35:40 +0100 Subject: support cloud projects --- binary.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/binary.sh b/binary.sh index 83b8d12..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:" @@ -65,11 +67,17 @@ then url=$3 fi - # 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 + 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 -- cgit v1.3.1