Skip to content

Commit 1c6674a

Browse files
authored
Merge pull request #157 from lightpanda-io/telemetry_config
provide a build_telemetry.cfg
2 parents 8832f13 + b552ea1 commit 1c6674a

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

build.zig

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,28 @@ fn bootstrapDepotTools(b: *std.Build, depot_tools_dir: []const u8) !*std.Build.S
188188
copy_depot_tools.addDirectoryArg(depot_tools.path(""));
189189
copy_depot_tools.addArg(depot_tools_dir);
190190

191+
const build_telemetry_config_content =
192+
\\ {
193+
\\ "user": "lightpanda",
194+
\\ "status": "opt-out",
195+
\\ "countdown": 20,
196+
\\ "version": 1
197+
\\ }
198+
;
199+
200+
const write_telemetry_config = b.addSystemCommand(&.{ "sh", "-c" });
201+
write_telemetry_config.addArg(b.fmt("echo '{s}' > {s}/build_telemetry.cfg", .{
202+
build_telemetry_config_content,
203+
depot_tools_dir,
204+
}));
205+
write_telemetry_config.step.dependOn(&copy_depot_tools.step);
206+
191207
const ensure_bootstrap = b.addSystemCommand(&.{
192208
getDepotToolExePath(b, depot_tools_dir, "ensure_bootstrap"),
193209
});
194210
ensure_bootstrap.setCwd(.{ .cwd_relative = depot_tools_dir });
195211
addDepotToolsToPath(ensure_bootstrap, depot_tools_dir);
196-
ensure_bootstrap.step.dependOn(&copy_depot_tools.step);
212+
ensure_bootstrap.step.dependOn(&write_telemetry_config.step);
197213

198214
const create_marker = b.addSystemCommand(&.{ "touch", marker_file });
199215
create_marker.step.dependOn(&ensure_bootstrap.step);

0 commit comments

Comments
 (0)