diff options
author | 2023-01-28 23:23:26 -0800 | |
---|---|---|
committer | 2023-01-28 23:23:26 -0800 | |
commit | f087388ebc6314c2852d553f4f4ea3074369dfbe (patch) | |
tree | 935a0c205b3eccca29f3bcc5e3db18f7fdc4469d /src/cli | |
parent | 48eb0c12ab2c568d7ff706c2b0a6616d428032c8 (diff) | |
download | bun-f087388ebc6314c2852d553f4f4ea3074369dfbe.tar.gz bun-f087388ebc6314c2852d553f4f4ea3074369dfbe.tar.zst bun-f087388ebc6314c2852d553f4f4ea3074369dfbe.zip |
Support running WASI (WebAssembly) files using `bun run` (#1929)
* another micro bench
* Support running WASI
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/cli')
-rw-r--r-- | src/cli/run_command.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cli/run_command.zig b/src/cli/run_command.zig index dc0138310..b6784cdf2 100644 --- a/src/cli/run_command.zig +++ b/src/cli/run_command.zig @@ -857,7 +857,7 @@ pub const RunCommand = struct { possibly_open_with_bun_js: { if (!force_using_bun) { if (options.defaultLoaders.get(std.fs.path.extension(script_name_to_search))) |load| { - if (!load.isJavaScriptLike()) + if (!(load.isJavaScriptLike() or load == .wasm)) break :possibly_open_with_bun_js; } else { break :possibly_open_with_bun_js; @@ -898,9 +898,9 @@ pub const RunCommand = struct { }; var shebang: string = shebang_buf[0..shebang_size]; + shebang = std.mem.trim(u8, shebang, " \r\n\t"); if (shebang.len == 0) break :possibly_open_with_bun_js; - if (strings.hasPrefixComptime(shebang, "#!")) { const first_arg: string = if (std.os.argv.len > 0) bun.span(std.os.argv[0]) else ""; const filename = std.fs.path.basename(first_arg); |