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:
Roger
2026-04-01 10:28:40 +08:00
parent ff43ce0b74
commit db96abfa70
3 changed files with 2 additions and 12 deletions

View File

@@ -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