Skip to content
This repository has been archived by the owner on Mar 26, 2020. It is now read-only.

Fix to escape options containing ‘<>’ on windows platform #419

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/run
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@ base_dir=$(cd "`dirname "$loc"`" > /dev/null && pwd)
# Determine os version and choose correspondent .sh or .bat file accordingly.
os_version="`uname -a`"

if [[ $os_version == *"MINGW"* ]]; then
cmd //C "$base_dir/target/start.bat" "$@"
else
if [[ $os_version == *"MINGW"* ]]; then
PARAMS=""
for PARAM in "$@"
do
escaped="${PARAM/</^^^<}"
escaped="${escaped/>/^^^>}"
PARAMS=( ${PARAMS[@]} "${escaped}" )
done
cmd //C "$base_dir/target/start.bat" "${PARAMS[@]}"
else
exec "$base_dir/target/start" "$@"
fi