aboutsummaryrefslogtreecommitdiff
path: root/src/cli.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli.zig')
-rw-r--r--src/cli.zig36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/cli.zig b/src/cli.zig
index 263308b98..058a416d4 100644
--- a/src/cli.zig
+++ b/src/cli.zig
@@ -1,15 +1,15 @@
-const _global = @import("global.zig");
-const string = _global.string;
-const Output = _global.Output;
-const Global = _global.Global;
-const Environment = _global.Environment;
-const strings = _global.strings;
-const MutableString = _global.MutableString;
-const stringZ = _global.stringZ;
-const default_allocator = _global.default_allocator;
-const constStrToU8 = _global.constStrToU8;
-const FeatureFlags = _global.FeatureFlags;
-const C = _global.C;
+const bun = @import("global.zig");
+const string = bun.string;
+const Output = bun.Output;
+const Global = bun.Global;
+const Environment = bun.Environment;
+const strings = bun.strings;
+const MutableString = bun.MutableString;
+const stringZ = bun.stringZ;
+const default_allocator = bun.default_allocator;
+const constStrToU8 = bun.constStrToU8;
+const FeatureFlags = bun.FeatureFlags;
+const C = bun.C;
const std = @import("std");
const lex = @import("js_lexer.zig");
@@ -248,7 +248,7 @@ pub const Arguments = struct {
try Bunfig.parse(allocator, logger.Source.initPathString(std.mem.span(config_path), contents), ctx, cmd);
}
- fn getHomeConfigPath(buf: *[_global.MAX_PATH_BYTES]u8) ?[:0]const u8 {
+ fn getHomeConfigPath(buf: *[bun.MAX_PATH_BYTES]u8) ?[:0]const u8 {
if (std.os.getenvZ("XDG_CONFIG_HOME") orelse std.os.getenvZ("HOME")) |data_dir| {
var paths = [_]string{".bunfig.toml"};
var outbuf = resolve_path.joinAbsStringBuf(data_dir, buf, &paths, .auto);
@@ -260,7 +260,7 @@ pub const Arguments = struct {
}
pub fn loadConfig(allocator: std.mem.Allocator, user_config_path_: ?string, ctx: *Command.Context, comptime cmd: Command.Tag) !void {
- var config_buf: [_global.MAX_PATH_BYTES]u8 = undefined;
+ var config_buf: [bun.MAX_PATH_BYTES]u8 = undefined;
if (comptime cmd.readGlobalConfig()) {
if (getHomeConfigPath(&config_buf)) |path| {
try loadConfigPath(allocator, true, path, ctx, comptime cmd);
@@ -286,7 +286,7 @@ pub const Arguments = struct {
config_path = config_buf[0..config_path_.len :0];
} else {
if (ctx.args.absolute_working_dir == null) {
- var secondbuf: [_global.MAX_PATH_BYTES]u8 = undefined;
+ var secondbuf: [bun.MAX_PATH_BYTES]u8 = undefined;
var cwd = std.os.getcwd(&secondbuf) catch return;
ctx.args.absolute_working_dir = try allocator.dupe(u8, cwd);
}
@@ -727,7 +727,7 @@ pub const PrintBundleCommand = struct {
@setCold(true);
const entry_point = ctx.args.entry_points[0];
- var out_buffer: [_global.MAX_PATH_BYTES]u8 = undefined;
+ var out_buffer: [bun.MAX_PATH_BYTES]u8 = undefined;
var stdout = std.io.getStdOut();
var input = try std.fs.openFileAbsolute(try std.os.realpath(entry_point, &out_buffer), .{ .mode = .read_only });
@@ -750,7 +750,7 @@ pub const PrintBundleCommand = struct {
};
pub const Command = struct {
- var script_name_buf: [_global.MAX_PATH_BYTES]u8 = undefined;
+ var script_name_buf: [bun.MAX_PATH_BYTES]u8 = undefined;
pub const DebugOptions = struct {
dump_environment_variables: bool = false,
@@ -1136,7 +1136,7 @@ pub const Command = struct {
break :brk std.fs.cwd().openFileZ(file_pathZ, .{ .mode = .read_only });
} else {
- var path_buf: [_global.MAX_PATH_BYTES]u8 = undefined;
+ var path_buf: [bun.MAX_PATH_BYTES]u8 = undefined;
const cwd = std.os.getcwd(&path_buf) catch break :possibly_open_with_bun_js;
path_buf[cwd.len] = std.fs.path.sep;
var parts = [_]string{script_name_to_search};