提交记录修改tests/06-help-and-setup-script.sh+3 −0看文件
| @@ -222,6 +222,8 @@ section "code-server JSON schemas" | ||
| 222 | 222 | if ! command -v jq >/dev/null 2>&1 || [ "${BASH_VERSINFO[0]}" -lt 4 ]; then |
| 223 | 223 | printf ' skip code-server schema tests (needs jq and bash 4)\n' |
| 224 | 224 | else |
| 225 | 新增: # A native jq.exe writes CRLF unless -b, and mapfile keeps the CR. | |
| 226 | 新增: if _agent_vm_on_windows; then jq() { command jq -b "$@"; }; fi | |
| 225 | 227 | SCH="$SB/schemas"; mkdir -p "$SCH/ext/a" "$SCH/ext/b" "$SCH/web" |
| 226 | 228 | web() { printf '%s' "$1" | tr -c 'a-zA-Z0-9' _; } |
| 227 | 229 | echo '{"contributes":{"jsonValidation":[{"fileMatch":"a.json","url":"https://h.test/s/a"},{"fileMatch":"x","url":"vscode://schemas/x"}]}}' > "$SCH/ext/a/package.json" |
| @@ -255,6 +257,7 @@ else | ||
| 255 | 257 | *"could not download the JSON schema https://h.test/gone"*"rc=0") pass "a failed download is a warning, not a failure" ;; |
| 256 | 258 | *) fail "failed download: $out" ;; |
| 257 | 259 | esac |
| 260 | 新增: unset -f jq | |
| 258 | 261 | fi |
| 259 | 262 | |
| 260 | 263 | # ============================================================================= |

