From a3daa829fc26a2673ff4638e051eeb0cc0477c8f Mon Sep 17 00:00:00 2001 From: cnc Date: Fri, 5 Jun 2026 22:46:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E9=BD=90=20switchkins=20=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E8=B7=AF=E5=BE=84=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- check-linuxcnc-switchkins-remap-table.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/check-linuxcnc-switchkins-remap-table.sh b/check-linuxcnc-switchkins-remap-table.sh index 2c3c0bc..805c7b3 100755 --- a/check-linuxcnc-switchkins-remap-table.sh +++ b/check-linuxcnc-switchkins-remap-table.sh @@ -381,6 +381,7 @@ validate_generator_cli_contract() { local cli_manifest_without_remap local cli_manifest_without_tooldata local cli_output_root_log + local cli_output_file_log local cli_output_whitespace_log cli_dir=$(mktemp -d "${TMPDIR:-/tmp}/linuxcnc_switchkins_remap_cli.XXXXXX") trap 'rm -rf "$cli_dir"' EXIT @@ -411,6 +412,7 @@ validate_generator_cli_contract() { cli_manifest_without_remap="$cli_dir/bridgemill-manifest-without-remap.txt" cli_manifest_without_tooldata="$cli_dir/bridgemill-manifest-without-tooldata.txt" cli_output_root_log="$cli_dir/output-root.log" + cli_output_file_log="$cli_dir/output-file.log" cli_output_whitespace_log="$cli_dir/output-whitespace.log" if ! awk -F: -v manifest="$manifest_file" ' @@ -769,6 +771,18 @@ validate_generator_cli_contract() { sed -n '1,20p' "$cli_output_root_log" >&2 exit 1 fi + printf 'not a directory\n' >"$cli_dir/output-file" + if LINUXCNC_ROOT="$linuxcnc_root" ./generate-linuxcnc-switchkins-remap-table.sh \ + --all-output-dir "$cli_dir/output-file" "$cli_manifest" >"$cli_output_file_log" 2>&1; then + echo "switchkins remap generator accepted a file as output directory" >&2 + exit 1 + fi + if ! grep -F "switchkins remap output path is not a directory: $cli_dir/output-file" \ + "$cli_output_file_log" >/dev/null; then + echo "switchkins remap generator did not report file output paths clearly" >&2 + sed -n '1,20p' "$cli_output_file_log" >&2 + exit 1 + fi LINUXCNC_ROOT="$linuxcnc_root" ./generate-linuxcnc-switchkins-remap-table.sh --all-output-dir "$cli_dir/out" "$cli_manifest" LINUXCNC_ROOT="$linuxcnc_root" ./generate-linuxcnc-switchkins-remap-table.sh "$cli_manifest" \