11#! /usr/bin/env bash
22# -*- mode: shell-script
33
4- export NODE_NO_WARNINGS=1
5-
6- # use a special window sizing and positioning
7- # export KUI_POPUP_WINDOW_RESIZE=true
8-
9- # use a fixed popup window sizing of our choosing
10- # export WINDOW_WIDTH=1024
11- # export WIDTH_HEIGHT=768
12-
13- # This tells the core Kui plugin resolver that we are using webpack to
14- # build our headless bundles, not the old headless hacks
15- export KUI_HEADLESS_WEBPACK=true
16-
174SCRIPTDIR=$( cd $( dirname " $0 " ) && pwd)
185
196if [ -n " $NODE " ] && [ -n " $HEADLESS " ]; then
9683 exit 1
9784fi
9885
99- # This points the headless->electron launcher to our Electron
100- export KUI_ELECTRON_HOME=" ${KUI_ELECTRON_HOME-$NODE } "
101-
10286if [ -z " $GUIDEBOOK_STORE " ]; then
10387 if [ -d " $HEADLESS " /../../node_modules/@guidebooks/store/dist/store ]; then
10488 # development
@@ -115,31 +99,20 @@ if [ -z "$GUIDEBOOK_STORE" ]; then
11599 fi
116100fi
117101
118- do_cli=1
119- use_docker=0
120- while getopts " piqaydnVs:t:" opt
121- do
122- case $opt in
123- d) use_docker=1; continue ;;
124- s) export GUIDEBOOK_STORE=$OPTARG ; continue ;;
125- * ) continue ;;
126- esac
127- done
128- # shift $((OPTIND-1))
102+ # launch headless version; here, we use madwizard directly, but
103+ # using electron as the nodejs binary (this is what
104+ # ELECTRON_RUN_AS_NODE does for us)
105+ export KUI_HEADLESS=true
106+ export KUI_S3=${KUI_S3-false} # we don't need plugin-s3 capabilities when in headless mode
107+ export ELECTRON_RUN_AS_NODE=true
129108
130- if [ $use_docker = 1 ] ; then
131- # launch inside a docker container
132- exec docker run -it --entrypoint ${ENTRYPOINT-codeflare} --rm -v /tmp:/tmp -v ~ /.aws:/home/codeflare/.aws -v ~ /.bluemix:/home/codeflare/.bluemix -v ~ /.kube:/home/codeflare/.kube -e KUBECONFIG= $( echo $KUBECONFIG | sed " s/ $USER /codeflare/g " | sed ' s/Users/home/g ' ) ghcr.io/project-codeflare/codeflare-cli -- $*
133- fi
109+ # This tells the core Kui plugin resolver that we are using webpack to
110+ # build our headless bundles, not the old headless hacks. In the next
111+ # major semver of Kui, this should no longer be necessary.
112+ export KUI_HEADLESS_WEBPACK=true
134113
135- if [ " $do_cli " = " 1" ]; then
136- # launch headless version; here, we use madwizard directly, but
137- # using electron as the nodejs binary (this is what
138- # ELECTRON_RUN_AS_NODE does for us)
139- export KUI_HEADLESS=true
140- export KUI_S3=${KUI_S3-false} # we don't need plugin-s3 capabilities when in headless mode
141- export ELECTRON_RUN_AS_NODE=true
142- fi
114+ # This points the headless->electron launcher to our Electron
115+ export KUI_ELECTRON_HOME=" ${KUI_ELECTRON_HOME-$NODE } "
143116
144117# Linux may not have the prereqs needed to run Electron
145118if [ " $NODE " != " node" ] && [ ! -f ~ /.codeflare ] && [ $( uname) = Linux ]; then
0 commit comments