aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-10-26 16:18:51 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-10-26 16:18:51 -0700
commit9ce38b86aba2068d5388f849b274380728c55952 (patch)
tree8949256f76cd70471ff6f928af27a2c478d1c2f6
parent05bdda7b0700f6c3dfbacab9b0b348dd82c0f1dd (diff)
downloadbun-9ce38b86aba2068d5388f849b274380728c55952.tar.gz
bun-9ce38b86aba2068d5388f849b274380728c55952.tar.zst
bun-9ce38b86aba2068d5388f849b274380728c55952.zip
Fix edgecase with options loading attempting to create an output directory when it shouldn't
-rw-r--r--src/cli.zig14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/cli.zig b/src/cli.zig
index 399cd58a6..df9357cf3 100644
--- a/src/cli.zig
+++ b/src/cli.zig
@@ -298,13 +298,15 @@ pub const Arguments = struct {
}
const production = false; //args.flag("--production");
-
- var write = entry_points.len > 1 or output_dir != null;
- if (write and output_dir == null) {
- var _paths = [_]string{ cwd, "out" };
- output_dir = try std.fs.path.resolve(allocator, &_paths);
+ if (comptime cmd == .BuildCommand) {
+ var write = entry_points.len > 1 or output_dir != null;
+ if (write and output_dir == null) {
+ var _paths = [_]string{ cwd, "out" };
+ output_dir = try std.fs.path.resolve(allocator, &_paths);
+ }
+ opts.write = write;
}
- opts.write = write;
+
opts.entry_points = entry_points;
var jsx_factory = args.option("--jsx-factory");