aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Alex Lam S.L <alexlamsl@gmail.com> 2023-06-13 15:38:10 +0300
committerGravatar GitHub <noreply@github.com> 2023-06-13 05:38:10 -0700
commitc8d06f04d3f0eb783f8f315654a23eff5654015e (patch)
tree0bbb800360f732ae904f7cf42c43946532300726 /src
parent067a0235e49c52ac66df10cf2240b7ecb22eb599 (diff)
downloadbun-c8d06f04d3f0eb783f8f315654a23eff5654015e.tar.gz
bun-c8d06f04d3f0eb783f8f315654a23eff5654015e.tar.zst
bun-c8d06f04d3f0eb783f8f315654a23eff5654015e.zip
workaround quote escape issues for `bun run` (#3290)
fixes #53
Diffstat (limited to 'src')
-rw-r--r--src/cli/run_command.zig18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/cli/run_command.zig b/src/cli/run_command.zig
index 24304f169..0c9145db1 100644
--- a/src/cli/run_command.zig
+++ b/src/cli/run_command.zig
@@ -192,6 +192,24 @@ pub const RunCommand = struct {
delimiter = 0;
},
+ // TODO: handle escape sequences properly
+ // https://github.com/oven-sh/bun/issues/53
+ '\\' => {
+ delimiter = 0;
+
+ if (entry_i + 1 < script.len) {
+ switch (script[entry_i + 1]) {
+ '"', '\'' => {
+ entry_i += 1;
+ continue;
+ },
+ '\\' => {
+ entry_i += 1;
+ },
+ else => {},
+ }
+ }
+ },
else => {
delimiter = 0;
},