File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
webapp/src/main/resources/templates/cli Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1919mkdir -p {{installDirectory}}
2020
2121# Create the bash wrapper for the CLI
22- cat << ' EOF ' | envsubst '$PWD' > {{installDirectory}}/mojito
22+ cat > {{installDirectory}}/mojito-tmp << ' EOF '
2323#!/usr/bin/env bash
2424{{#hasHeaders}}
2525{{#headers}}
2626if [ -z "{{{envVarPresenceCheck}}}" ]; then
2727 echo "Environment variable {{envVar}} must be set before running this command."
28- exit 1
2928fi
3029{{/headers}}
3130{{#authenticationMode}}
@@ -39,6 +38,10 @@ java -Dl10n.resttemplate.host={{host}} \
3938 -jar {{installDirectory}}/mojito-cli.jar "$@" ;
4039EOF
4140
41+ _ESC=" $( printf ' %s' " ${PWD} " | sed ' s/[\/&]/\\&/g' ) "
42+ sed " s|\$ {PWD}|$_ESC |g" {{installDirectory}}/mojito-tmp > {{installDirectory}}/mojito
43+ rm {{installDirectory}}/mojito-tmp
44+
4245# Make the wrapper executable
4346chmod +x {{installDirectory}}/mojito
4447
You can’t perform that action at this time.
0 commit comments