aboutsummaryrefslogtreecommitdiff
path: root/src/cli/run_command.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/run_command.zig')
-rw-r--r--src/cli/run_command.zig4
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);