diff --git a/.github/e2e/windows-cases.txt b/.github/e2e/windows-cases.txt index 7d80bd522..87b152dbb 100644 --- a/.github/e2e/windows-cases.txt +++ b/.github/e2e/windows-cases.txt @@ -26,6 +26,7 @@ no-name-yet one-row-per-dependent path-crosses-framework-and-byname path-through-interface +quoted-literal-text receiver-from-an-importlib-module registration-key route-table-reaches-view diff --git a/bin/axiomcode b/bin/axiomcode index b5225e774..8236bff04 100755 --- a/bin/axiomcode +++ b/bin/axiomcode @@ -55,6 +55,10 @@ set -eu if [ -n "${AXIOMCODE_ARGV+x}" ]; then set --; while IFS= read -r -d $'\x1f' _a; do set -- "$@" "$_a"; done < <(printf '%s' "$AXIOMCODE_ARGV"); unset AXIOMCODE_ARGV _a fi +# and Git Bash's runtime rewrites an argument that looks like a POSIX path as it starts a native program, so +# `impact '"/orders/{code}"'` reached Python as "C:/Program Files/Git/orders/{code}". A quoted query is never a path: +# an argument that starts with a quote is left as written, and every other one (a repository path) is converted as before. +case "${OSTYPE:-}" in msys*|cygwin*) export MSYS2_ARG_CONV_EXCL="\"${MSYS2_ARG_CONV_EXCL:+;$MSYS2_ARG_CONV_EXCL}";; esac # RESOLVE $0 THROUGH SYMLINKS BEFORE THE WALK. npm installs a `bin` entry as a link in # node_modules/.bin, so under `npx axiomcode` or a global install $0 is that link and # dirname "$0" is .bin/, a directory this package does not live under. The walk below then diff --git a/plugins/axiomcode/skills/axiomcode/scripts/axiomcode b/plugins/axiomcode/skills/axiomcode/scripts/axiomcode index 8fea778ca..669ee227e 100755 --- a/plugins/axiomcode/skills/axiomcode/scripts/axiomcode +++ b/plugins/axiomcode/skills/axiomcode/scripts/axiomcode @@ -86,6 +86,10 @@ if [ -n "${AXIOMCODE_ARGV+x}" ]; then set --; while IFS= read -r -d $'\x1f' _a; do set -- "$@" "$_a"; done < <(printf '%s' "$AXIOMCODE_ARGV"); unset AXIOMCODE_ARGV _a fi +# and Git Bash's runtime rewrites an argument that looks like a POSIX path as it starts a native program, so +# `impact '"/orders/{code}"'` reached Python as "C:/Program Files/Git/orders/{code}". A quoted query is never a path: +# an argument that starts with a quote is left as written, and every other one (a repository path) is converted as before. +case "${OSTYPE:-}" in msys*|cygwin*) export MSYS2_ARG_CONV_EXCL="\"${MSYS2_ARG_CONV_EXCL:+;$MSYS2_ARG_CONV_EXCL}";; esac H="${0//\\//}"; case "$H" in */*) H="${H%/*}";; *) H=.;; esac; H="$(cd "${H:-/}" && pwd)" # no `dirname`: see bin/axiomcode # PYTHON UNDER ANOTHER NAME (#1331). Every verb runs `python3`, which a python.org install on Windows does not