diff options
author | 2021-10-05 02:27:49 -0700 | |
---|---|---|
committer | 2021-10-05 02:27:49 -0700 | |
commit | 00e7b7c3d53e41ff3df264bfe382a8fa70bb0b9d (patch) | |
tree | 1cb6bdd5eb389c934a799f94a1fa3985f8ec160c /src/bundler.zig | |
parent | d2be50bf4d87de13a6010e93e3f100412d6290d2 (diff) | |
download | bun-00e7b7c3d53e41ff3df264bfe382a8fa70bb0b9d.tar.gz bun-00e7b7c3d53e41ff3df264bfe382a8fa70bb0b9d.tar.zst bun-00e7b7c3d53e41ff3df264bfe382a8fa70bb0b9d.zip |
Simple analytics
Diffstat (limited to 'src/bundler.zig')
-rw-r--r-- | src/bundler.zig | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/bundler.zig b/src/bundler.zig index 2ca075760..8409f30e9 100644 --- a/src/bundler.zig +++ b/src/bundler.zig @@ -38,6 +38,7 @@ const Lock = @import("./lock.zig").Lock; const NewBunQueue = @import("./bun_queue.zig").NewBunQueue; const NodeFallbackModules = @import("./node_fallbacks.zig"); const CacheEntry = @import("./cache.zig").FsCacheEntry; +const Analytics = @import("./analytics/analytics_thread.zig"); const Linker = linker.Linker; const Resolver = _resolver.Resolver; @@ -231,8 +232,23 @@ pub const Bundler = struct { try this.env.load(&this.fs.fs, dir, true); } }, + .disable => { + this.env.loadProcess(); + }, else => {}, } + + if (this.env.map.get("DISABLE_BUN_ANALYTICS")) |should_disable| { + if (strings.eqlComptime(should_disable, "1")) { + Analytics.disabled = true; + } + } + + if (this.env.map.get("CI")) |IS_CI| { + if (strings.eqlComptime(IS_CI, "true")) { + Analytics.is_ci = true; + } + } } // This must be run after a framework is configured, if a framework is enabled |