diff options
author | 2023-06-13 15:38:10 +0300 | |
---|---|---|
committer | 2023-06-13 05:38:10 -0700 | |
commit | c8d06f04d3f0eb783f8f315654a23eff5654015e (patch) | |
tree | 0bbb800360f732ae904f7cf42c43946532300726 /src | |
parent | 067a0235e49c52ac66df10cf2240b7ecb22eb599 (diff) | |
download | bun-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.zig | 18 |
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; }, |