diff options
Diffstat (limited to 'src/cli/run_command.zig')
-rw-r--r-- | src/cli/run_command.zig | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/cli/run_command.zig b/src/cli/run_command.zig index 106e87a3c..490cbe111 100644 --- a/src/cli/run_command.zig +++ b/src/cli/run_command.zig @@ -1078,6 +1078,23 @@ pub const RunCommand = struct { } return true; + } else if ((script_name_to_search.len > 1 and script_name_to_search[0] == '/') or + (script_name_to_search.len > 2 and script_name_to_search[0] == '.' and script_name_to_search[1] == '/' and + script_name_to_search[script_name_to_search.len - 1] != '/')) + { + Run.boot(ctx, ctx.allocator.dupe(u8, script_name_to_search) catch unreachable) catch |err| { + if (Output.enable_ansi_colors) { + ctx.log.printForLogLevelWithEnableAnsiColors(Output.errorWriter(), true) catch {}; + } else { + ctx.log.printForLogLevelWithEnableAnsiColors(Output.errorWriter(), false) catch {}; + } + + Output.prettyErrorln("<r><red>error<r>: Failed to run <b>{s}<r> due to error <b>{s}<r>", .{ + std.fs.path.basename(script_name_to_search), + @errorName(err), + }); + Global.exit(1); + }; } }, } |