diff options
author | 2022-09-01 15:31:22 -0700 | |
---|---|---|
committer | 2022-09-01 15:31:22 -0700 | |
commit | 793a42e7f533c3ae5cd69255520e81c32de28aef (patch) | |
tree | 90abb02085e2665266c98cdbc722dae61ca26b9a /src | |
parent | 700c31dd131bd839c2cf28d6b34915fa111cead4 (diff) | |
download | bun-793a42e7f533c3ae5cd69255520e81c32de28aef.tar.gz bun-793a42e7f533c3ae5cd69255520e81c32de28aef.tar.zst bun-793a42e7f533c3ae5cd69255520e81c32de28aef.zip |
[bun run] Silence `.env` loaded log
Fixes https://github.com/oven-sh/bun/issues/1192
Diffstat (limited to 'src')
-rw-r--r-- | src/cli/run_command.zig | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cli/run_command.zig b/src/cli/run_command.zig index 0f440d453..ab16cdfcc 100644 --- a/src/cli/run_command.zig +++ b/src/cli/run_command.zig @@ -349,9 +349,9 @@ pub const RunCommand = struct { args.node_modules_bundle_path = null; args.node_modules_bundle_path_server = null; args.generate_node_module_bundle = false; - this_bundler.* = try bundler.Bundler.init(ctx.allocator, ctx.log, args, null, env); this_bundler.options.env.behavior = Api.DotEnvBehavior.load_all; + this_bundler.env.quiet = true; this_bundler.options.env.prefix = ""; this_bundler.resolver.care_about_bin_folder = true; @@ -390,7 +390,10 @@ pub const RunCommand = struct { } } - // Run .env in the root dir + // TODO: evaluate if we can skip running this in nested calls to bun run + // The reason why it's unclear: + // - Some scripts may do NODE_ENV=production bun run foo + // This would cause potentially a different .env file to be loaded this_bundler.runEnvLoader() catch {}; if (root_dir_info.getEntries()) |dir| { |