docs: document cli utility helpers

This commit is contained in:
Peter Steinberger
2026-06-04 10:55:01 -04:00
parent 8946648ace
commit cb5d43ba95
10 changed files with 18 additions and 0 deletions
+2
View File
@@ -1,3 +1,4 @@
// DNS setup helper for wide-area discovery using Tailscale addresses and CoreDNS.
import { spawnSync } from "node:child_process";
import fs from "node:fs";
import path from "node:path";
@@ -35,6 +36,7 @@ function run(cmd: string, args: string[], opts?: RunOpts): string {
}
function writeFileSudoIfNeeded(filePath: string, content: string): void {
// Zone/CoreDNS paths may be root-owned; fall back to sudo tee only after normal write fails.
try {
fs.writeFileSync(filePath, content, "utf-8");
return;