@@ -8,7 +8,11 @@ export NODE_NO_WARNINGS=1
8
8
# export NODE_OPTIONS="--no-warnings"
9
9
10
10
# 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
12
16
13
17
# This tells the core Kui plugin resolver that we are using webpack to
14
18
# build our headless bundles, not the old headless hacks
@@ -27,21 +31,11 @@ elif [ -f ${SCRIPTDIR}/../node_modules/electron/dist/electron ]; then
27
31
# development mode on Linux
28
32
NODE=${SCRIPTDIR} /../node_modules/electron/dist/electron
29
33
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
35
34
elif [ -f ./CodeFlare.app/Contents/MacOS/CodeFlare ]; then
36
35
# CodeFlare installed in CWD on macOS
37
36
BASE=" $PWD /CodeFlare.app"
38
37
NODE=" $BASE /Contents/MacOS/CodeFlare"
39
38
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"
45
39
elif [ -f " $SCRIPTDIR /../CodeFlare.app/Contents/MacOS/CodeFlare" ]; then
46
40
# CodeFlare installed in SCRIPTDIR on macOS
47
41
BASE=" $SCRIPTDIR /../CodeFlare.app"
@@ -84,30 +78,35 @@ elif [ -f ./CodeFlare ]; then
84
78
BASE=" $PWD "
85
79
NODE=" $BASE /CodeFlare"
86
80
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"
87
91
else
88
92
echo " Error: Could not find CodeFlare. Try setting CODEFLARE_HOME=/path/to/CodeFlare"
89
93
exit 1
90
94
fi
91
95
92
96
# This points the headless->electron launcher to our Electron
93
97
export 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
-
105
98
export CODEFLARE_HEADLESS_ZIP=$HEADLESS /../headless.zip
106
99
107
100
SCRIPTDIR=$( cd $( dirname " $0 " ) && pwd)
108
101
if [ -d " $SCRIPTDIR " /../store ]; then
102
+ # development builds
109
103
export GUIDEBOOK_STORE=" $SCRIPTDIR " /../store
104
+ elif [ -d " $SCRIPTDIR " /app/store ]; then
105
+ # production builds
106
+ export GUIDEBOOK_STORE=" $SCRIPTDIR " /app/store
110
107
else
108
+ # otherwise, we can't find a local mirror, so pull directly from
109
+ # git (network transfers!)
111
110
export GUIDEBOOK_STORE=git
112
111
fi
113
112
@@ -117,10 +116,15 @@ do_cli=1
117
116
while getopts " u" opt
118
117
do
119
118
case $opt in
120
- (u) do_cli=0; shift ; continue ;;
119
+ (u) do_cli=0; shift ; continue ;;
121
120
esac
122
121
done
123
122
123
+ if [ $# = 1 ]; then
124
+ # use the "guide" command if none was given
125
+ EXTRAPREFIX=" guide"
126
+ fi
127
+
124
128
if [ " $do_cli " = " 1" ]; then
125
129
# launch headless version; here, we use madwizard directly, but
126
130
# using electron as the nodejs binary (this is what
@@ -131,6 +135,9 @@ if [ "$do_cli" = "1" ]; then
131
135
--experimental-specifier-resolution=node --no-warnings --experimental-import-meta-resolve \
132
136
" $HEADLESS " /../../node_modules/madwizard/bin/madwizard.js \
133
137
$*
138
+ else
139
+ # tell the command handlers to run in UI mode
140
+ EXTRAPREFIX=" $EXTRAPREFIX -u"
134
141
fi
135
142
136
143
# Linux may not have the prereqs needed to run Electron
@@ -156,4 +163,4 @@ if [ ! -f ~/.codeflare ] && [ $(uname) = Linux ]; then
156
163
fi
157
164
158
165
# 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