From db6ac5f51bcc34651aa28e4b762e9b58a42e9ef3 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Mon, 24 May 2021 12:44:13 -0700 Subject: [PATCH] ok Former-commit-id: 5f72442386c143bda8669200e1ee7cd269ae9cf9 --- src/bundler.zig | 7 ++----- src/cli.zig | 5 +++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/bundler.zig b/src/bundler.zig index 489af2db46..57909a49ef 100644 --- a/src/bundler.zig +++ b/src/bundler.zig @@ -311,12 +311,9 @@ pub const Bundler = struct { // Resolving a public file has special behavior if (bundler.options.public_dir_enabled) { // On Windows, we don't keep the directory handle open forever because Windows doesn't like that. - const public_dir: std.fs.Dir = bundler.options.public_dir_handle orelse std.fs.openDirAbsolute(resolve_path.normalizeAndJoin( - bundler.fs.top_level_dir, - .auto, - bundler.options.public_dir, - ), .{}) catch |err| { + const public_dir: std.fs.Dir = bundler.options.public_dir_handle orelse std.fs.openDirAbsolute(bundler.options.public_dir, .{}) catch |err| { log.addErrorFmt(null, logger.Loc.Empty, allocator, "Opening public directory failed: {s}", .{@errorName(err)}) catch unreachable; + Output.printErrorln("Opening public directory failed: {s}", .{@errorName(err)}); bundler.options.public_dir_enabled = false; return error.PublicDirError; }; diff --git a/src/cli.zig b/src/cli.zig index e3c9fa1862..e24d257b93 100644 --- a/src/cli.zig +++ b/src/cli.zig @@ -180,8 +180,8 @@ pub const Cli = struct { var react_fast_refresh = args.flag("--react-fast-refresh"); var main_fields = args.options("--main-fields"); - comptime const PlatformMatcher = strings.ExactSizeMatcher(8); - comptime const ResoveMatcher = strings.ExactSizeMatcher(8); + const PlatformMatcher = strings.ExactSizeMatcher(8); + const ResoveMatcher = strings.ExactSizeMatcher(8); var resolve = Api.ResolveMode.lazy; if (args.option("--resolve")) |_resolve| { @@ -295,6 +295,7 @@ pub const Cli = struct { if (args.serve orelse false) { try Server.start(allocator, args); + return; }