burnboard-cli 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.mjs +3 -3
- package/install/burnboard-setup.ps1 +1 -1
- package/install/burnboard-setup.sh +1 -1
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -48,12 +48,12 @@ function update() {
|
|
|
48
48
|
if (!fs.existsSync(configPath)) throw new Error("BurnBoard is not installed. Run the setup command first.");
|
|
49
49
|
const config = JSON.parse(fs.readFileSync(configPath, "utf8").replace(/^\uFEFF/, ""));
|
|
50
50
|
if (!config.token) throw new Error("The existing BurnBoard configuration is incomplete. Run setup again with your name.");
|
|
51
|
-
const force = args.includes("--force"),
|
|
52
|
-
|
|
51
|
+
const force = args.includes("--force"), installedVersion = fs.existsSync(installedVersionPath) ? fs.readFileSync(installedVersionPath, "utf8").trim() : "";
|
|
52
|
+
const lastCheck = fs.existsSync(lastUpdateCheckPath) ? Date.parse(fs.readFileSync(lastUpdateCheckPath, "utf8").trim()) : 0;
|
|
53
|
+
if (!force && installedVersion === cliVersion && Number.isFinite(lastCheck) && Date.now() - lastCheck < 20 * 60 * 60 * 1000) {
|
|
53
54
|
console.log("BurnBoard update check skipped; it already ran recently.");
|
|
54
55
|
return;
|
|
55
56
|
}
|
|
56
|
-
const installedVersion = fs.existsSync(installedVersionPath) ? fs.readFileSync(installedVersionPath, "utf8").trim() : "";
|
|
57
57
|
if (!force && installedVersion === cliVersion) {
|
|
58
58
|
fs.writeFileSync(lastUpdateCheckPath, `${new Date().toISOString()}\n`);
|
|
59
59
|
console.log(`BurnBoard is already up to date (${cliVersion}).`);
|
|
@@ -41,7 +41,7 @@ Register-ScheduledTask -TaskName "Burnboard Token Sync" -Action $action -Trigger
|
|
|
41
41
|
$npx=(Get-Command npx.cmd -ErrorAction Stop).Source
|
|
42
42
|
$updateLauncher=Join-Path $installDir "update-hidden.vbs"
|
|
43
43
|
$npxVbs=$npx.Replace('"','""')
|
|
44
|
-
$updateLauncherText="Set shell = CreateObject(`"WScript.Shell`")`r`ncommand = Chr(34) & `"$npxVbs`" & Chr(34) & `" --yes burnboard-cli@latest update`"`r`nexitCode = shell.Run(command, 0, True)`r`nWScript.Quit exitCode`r`n"
|
|
44
|
+
$updateLauncherText="Set shell = CreateObject(`"WScript.Shell`")`r`ncommand = Chr(34) & `"$npxVbs`" & Chr(34) & `" --yes --prefer-online burnboard-cli@latest update`"`r`nexitCode = shell.Run(command, 0, True)`r`nWScript.Quit exitCode`r`n"
|
|
45
45
|
[System.IO.File]::WriteAllText($updateLauncher,$updateLauncherText,$utf8NoBom)
|
|
46
46
|
$updateAction=New-ScheduledTaskAction -Execute $wscript -Argument "//B //NoLogo `"$updateLauncher`""
|
|
47
47
|
$dailyUpdateTrigger=New-ScheduledTaskTrigger -Daily -At "4:00 AM"
|
|
@@ -16,7 +16,7 @@ node -e 'require("fs").writeFileSync(process.argv[1],JSON.stringify({serverUrl:p
|
|
|
16
16
|
node - "$HOME/.claude/settings.json" <<'NODE'
|
|
17
17
|
const fs=require('fs'),file=process.argv[2],current=fs.existsSync(file)?JSON.parse(fs.readFileSync(file,'utf8')):{};current.env=current.env||{};for(const key of ['CLAUDE_CODE_ENABLE_TELEMETRY','OTEL_METRICS_EXPORTER','OTEL_LOGS_EXPORTER','OTEL_EXPORTER_OTLP_METRICS_PROTOCOL','OTEL_EXPORTER_OTLP_METRICS_ENDPOINT','OTEL_EXPORTER_OTLP_METRICS_HEADERS','OTEL_METRIC_EXPORT_INTERVAL','OTEL_METRICS_INCLUDE_SESSION_ID'])delete current.env[key];fs.writeFileSync(file,JSON.stringify(current,null,2)+"\n");
|
|
18
18
|
NODE
|
|
19
|
-
printf '[3/5] Scheduling automatic sync...\n'; (crontab -l 2>/dev/null|grep -Ev 'burnboard/agent.mjs|burnboard-cli@latest update'||true;echo "*/5 * * * * $(command -v node) $INSTALL_DIR/agent.mjs >/dev/null 2>&1";echo "0 4 * * * $(command -v npx) --yes burnboard-cli@latest update >/dev/null 2>&1";echo "@reboot sleep 180 && $(command -v npx) --yes burnboard-cli@latest update >/dev/null 2>&1")|crontab -
|
|
19
|
+
printf '[3/5] Scheduling automatic sync...\n'; (crontab -l 2>/dev/null|grep -Ev 'burnboard/agent.mjs|burnboard-cli@latest update'||true;echo "*/5 * * * * $(command -v node) $INSTALL_DIR/agent.mjs >/dev/null 2>&1";echo "0 4 * * * $(command -v npx) --yes --prefer-online burnboard-cli@latest update >/dev/null 2>&1";echo "@reboot sleep 180 && $(command -v npx) --yes --prefer-online burnboard-cli@latest update >/dev/null 2>&1")|crontab -
|
|
20
20
|
if [[ "$(uname -s)" == "Darwin" ]] && ! pgrep -x Antigravity >/dev/null 2>&1 && [[ -d "/Applications/Antigravity.app" ]]; then open -a Antigravity; sleep 8; fi
|
|
21
21
|
printf '[4/5] Counting and uploading local history'; OUT="$INSTALL_DIR/setup-sync.out"; ERR="$INSTALL_DIR/setup-sync.err"; node "$INSTALL_DIR/agent.mjs" >"$OUT" 2>"$ERR" & PID=$!
|
|
22
22
|
while kill -0 "$PID" 2>/dev/null; do printf '.'; sleep 1; done
|