mirror of
https://github.com/roger2ai/Claude-Code-Compiled.git
synced 2026-06-07 05:29:22 +08:00
fix: change -d2e to -D in source instead of patching Commander.js
bun build caches Commander.js from npm, making postinstall sed patch ineffective. Directly changed the flag to single-char -D in: - src/main.tsx (Option definition) - src/utils/debug.ts (argv check) Removed Commander.js patching from postinstall.sh.
This commit is contained in:
@@ -117,13 +117,3 @@ STUBEOF
|
||||
fi
|
||||
|
||||
echo "[postinstall] Stubs created."
|
||||
|
||||
# ── Patch Commander.js for multi-char short flags ───────────────────────────
|
||||
OPTION_JS=$(find node_modules -path "*/commander/lib/option.js" -type f | head -1)
|
||||
if [ -n "$OPTION_JS" ]; then
|
||||
# Patch 1: shortFlagExp — allow one or more chars after dash
|
||||
sed -i "s|shortFlagExp = /\^-\\[^-\\]\\$/|shortFlagExp = /\^-[^-]+\$/|" "$OPTION_JS"
|
||||
# Patch 2: disable single-char short flag restriction
|
||||
sed -i "s|if (/\\^-\\[^-\\]\\[^-\\]/.test(unsupportedFlag))|if (false)|" "$OPTION_JS"
|
||||
echo "[postinstall] Patched Commander.js for multi-char short flags"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user