Skip to content

Commit f32286b

Browse files
committed
fix: For unescaped brackets in the patch file
1 parent 1b52ed8 commit f32286b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

scripts/patch-oclif.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ if (idx === -1) {
5151
// Patch uses \\$ so that it survives the JS string — in the generated shell script each \\$ becomes \$
5252
// which Bash then interprets as a literal $ (not a template substitution in the JS template literal).
5353
const PATCH = ` # CODIFY_PATCH_START — do not remove this marker
54-
_first_arg="\${1:-}"
54+
_first_arg=""
55+
if [ "\\$#" -gt 0 ]; then _first_arg="\\$1"; fi
5556
if [ "\\$_first_arg" = "--help" ] || [ "\\$_first_arg" = "-h" ]; then
5657
_help_file="\\$DIR/../dist/static/help.txt"
5758
if [ -f "\\$_help_file" ]; then cat "\\$_help_file"; exit 0; fi

0 commit comments

Comments
 (0)