3 source $FEISTY_MEOW_SCRIPTS/core/functions.sh
5 # for a windows build, this will replace any forward slashes
6 # and other cygwin notation with the appropriate dos style paths.
7 function dossify_and_run_commands()
9 if [ "$OS" != "Windows_NT" ]; then
10 # for non windows, just run the commands straight up.
15 # force all slashes to be dossy.
16 # export SERIOUS_SLASH_TREATMENT=true
18 declare -a darc_commands=()
21 if [[ "$i" =~ ^-[a-zA-z][/\"].* ]]; then
23 filename="$(unix_to_dos_path ${i:2})"
24 #echo "first two chars are $flag"
25 #echo "last after that are $filename"
26 recombined="$flag$filename"
27 #echo combined flag and file is $recombined
28 darc_commands+=("$recombined")
30 darc_commands+=($(unix_to_dos_path $i))
34 declare -a real_commands=()
35 for i in "${darc_commands[@]}"; do
36 real_commands+=($(echo $i | sed -e 's/\\/\\\\/g'))
39 if [ ! -z "$SHELL_DEBUG" ]; then
40 echo commands are now:
41 for i in "${real_commands[@]}"; do
47 # now actually run the chewed command.
48 cmd /c "${real_commands[@]}"
51 dossify_and_run_commands "$@"