# CYGWIN
echo "When using relative paths in args within Cygwin, please start with './' or '../'" >&2
CLASSPATH=$(cygpath -pw "${CLASSPATH}")
- # now for some arg paths fun. only translating paths starting with './', '../' or '/'
+ # now for some arg paths fun. only translating paths starting with './', '../', '/' or '~'
ARGS=()
for ARG in "${@}"; do
- if [ "${ARG}" != "${ARG#./}" -o "${ARG}" != "${ARG#/}" -o "${ARG}" != "${ARG#../}" ]; then
+ if [ "${ARG}" != "${ARG#@(/|./|../|~)}" ]; then
ARGS=( "${ARGS[@]}" "$(cygpath -aw "${ARG}")" )
else
ARGS=( "${ARGS[@]}" "${ARG}" )
done
ARGS=()
for ARG in "${@}"; do
- if [ "${ARG}" != "${ARG#./}" -o "${ARG}" != "${ARG#/}" -o "${ARG}" != "${ARG#../}" ]; then
+ if [ "${ARG}" != "${ARG#@(/|./|../|~)}" ]; then
# annoyingly wslpath does not work if the file doesn't exist!
ARGBASENAME="$(basename "${ARG}")"
ARGDIRNAME="$(dirname "${ARG}")"