@@ -8,7 +8,11 @@ export NODE_NO_WARNINGS=1
88# export NODE_OPTIONS="--no-warnings"
99
1010# use a special window sizing and positioning
11- export KUI_POPUP_WINDOW_RESIZE=true
11+ # export KUI_POPUP_WINDOW_RESIZE=true
12+
13+ # use a fixed popup window sizing of our choosing
14+ export WINDOW_WIDTH=1024
15+ export WIDTH_HEIGHT=768
1216
1317# This tells the core Kui plugin resolver that we are using webpack to
1418# build our headless bundles, not the old headless hacks
@@ -27,21 +31,11 @@ elif [ -f ${SCRIPTDIR}/../node_modules/electron/dist/electron ]; then
2731 # development mode on Linux
2832 NODE=${SCRIPTDIR} /../node_modules/electron/dist/electron
2933 HEADLESS=${SCRIPTDIR} /../dist/headless
30- elif [ -f /Applications/CodeFlare.app/Contents/MacOS/CodeFlare ]; then
31- # CodeFlare installed in /Applications on macOS
32- BASE=/Applications/CodeFlare.app
33- NODE=" $BASE /Contents/MacOS/CodeFlare"
34- HEADLESS=$BASE /Contents/Resources/app/dist/headless
3534elif [ -f ./CodeFlare.app/Contents/MacOS/CodeFlare ]; then
3635 # CodeFlare installed in CWD on macOS
3736 BASE=" $PWD /CodeFlare.app"
3837 NODE=" $BASE /Contents/MacOS/CodeFlare"
3938 HEADLESS=" $BASE /Contents/Resources/app/dist/headless"
40- elif [ -f /usr/local/bin/CodeFlare/CodeFlare ]; then
41- # CodeFlare installed in /usr/local/bin on Linux or Windows
42- BASE=/usr/local/bin/CodeFlare
43- NODE=" $BASE /CodeFlare"
44- HEADLESS=" $BASE /resources/headless"
4539elif [ -f " $SCRIPTDIR /../CodeFlare.app/Contents/MacOS/CodeFlare" ]; then
4640 # CodeFlare installed in SCRIPTDIR on macOS
4741 BASE=" $SCRIPTDIR /../CodeFlare.app"
@@ -84,30 +78,35 @@ elif [ -f ./CodeFlare ]; then
8478 BASE=" $PWD "
8579 NODE=" $BASE /CodeFlare"
8680 HEADLESS=" $BASE /resources/headless"
81+ elif [ -f /Applications/CodeFlare.app/Contents/MacOS/CodeFlare ]; then
82+ # CodeFlare installed in /Applications on macOS
83+ BASE=/Applications/CodeFlare.app
84+ NODE=" $BASE /Contents/MacOS/CodeFlare"
85+ HEADLESS=$BASE /Contents/Resources/app/dist/headless
86+ elif [ -f /usr/local/bin/CodeFlare/CodeFlare ]; then
87+ # CodeFlare installed in /usr/local/bin on Linux or Windows
88+ BASE=/usr/local/bin/CodeFlare
89+ NODE=" $BASE /CodeFlare"
90+ HEADLESS=" $BASE /resources/headless"
8791else
8892 echo " Error: Could not find CodeFlare. Try setting CODEFLARE_HOME=/path/to/CodeFlare"
8993 exit 1
9094fi
9195
9296# This points the headless->electron launcher to our Electron
9397export KUI_ELECTRON_HOME=" ${KUI_ELECTRON_HOME-$NODE } "
94-
95- if [ $# = 1 ] && [ " $1 " = " -v" ] || [ " $1 " = " --version" ]; then
96- shift
97- args=(version)
98- elif [ $# = 1 ] && [ " $1 " = " -c" ] || [ " $1 " = " --check" ]; then
99- shift
100- args=(" help -c" )
101- else
102- args=$@
103- fi
104-
10598export CODEFLARE_HEADLESS_ZIP=$HEADLESS /../headless.zip
10699
107100SCRIPTDIR=$( cd $( dirname " $0 " ) && pwd)
108101if [ -d " $SCRIPTDIR " /../store ]; then
102+ # development builds
109103 export GUIDEBOOK_STORE=" $SCRIPTDIR " /../store
104+ elif [ -d " $SCRIPTDIR " /app/store ]; then
105+ # production builds
106+ export GUIDEBOOK_STORE=" $SCRIPTDIR " /app/store
110107else
108+ # otherwise, we can't find a local mirror, so pull directly from
109+ # git (network transfers!)
111110 export GUIDEBOOK_STORE=git
112111fi
113112
@@ -117,10 +116,15 @@ do_cli=1
117116while getopts " u" opt
118117do
119118 case $opt in
120- (u) do_cli=0; shift ; continue ;;
119+ (u) do_cli=0; shift ; continue ;;
121120 esac
122121done
123122
123+ if [ $# = 1 ]; then
124+ # use the "guide" command if none was given
125+ EXTRAPREFIX=" guide"
126+ fi
127+
124128if [ " $do_cli " = " 1" ]; then
125129 # launch headless version; here, we use madwizard directly, but
126130 # using electron as the nodejs binary (this is what
@@ -131,6 +135,9 @@ if [ "$do_cli" = "1" ]; then
131135 --experimental-specifier-resolution=node --no-warnings --experimental-import-meta-resolve \
132136 " $HEADLESS " /../../node_modules/madwizard/bin/madwizard.js \
133137 $*
138+ else
139+ # tell the command handlers to run in UI mode
140+ EXTRAPREFIX=" $EXTRAPREFIX -u"
134141fi
135142
136143# Linux may not have the prereqs needed to run Electron
@@ -156,4 +163,4 @@ if [ ! -f ~/.codeflare ] && [ $(uname) = Linux ]; then
156163fi
157164
158165# otherwise, we launch the UI version
159- exec " $NODE " " $HEADLESS " /codeflare.min.js -- $args 3>&1 1>&2 2>&3 3>& - | grep -v WebSwapCGLLayer
166+ exec " $NODE " " $HEADLESS " /codeflare.min.js -- $EXTRAPREFIX $* 3>&1 1>&2 2>&3 3>& - | grep -v WebSwapCGLLayer
0 commit comments