burnboard-cli 0.3.1 → 0.3.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 +4 -4
- package/install/burnboard-setup.sh +13 -2
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -26,7 +26,7 @@ function run(executable, runArgs) {
|
|
|
26
26
|
return result.status ?? 1;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
function setup(nameOverride) {
|
|
29
|
+
function setup(nameOverride, mode = "setup") {
|
|
30
30
|
const name = nameOverride || option("--name", args.find((value) => !value.startsWith("-")));
|
|
31
31
|
const server = option("--server", "https://burnboard-public.vercel.app");
|
|
32
32
|
if (!name || name.startsWith("--")) throw new Error('A name is required. Example: npx burnboard-cli setup --name "Harsh Sawant"');
|
|
@@ -34,7 +34,7 @@ function setup(nameOverride) {
|
|
|
34
34
|
if (process.platform === "win32") {
|
|
35
35
|
status = run("powershell.exe", ["-NoLogo", "-NoProfile", "-ExecutionPolicy", "Bypass", "-File", path.join(installRoot, "burnboard-setup.ps1"), "-Name", name, "-ServerUrl", server]);
|
|
36
36
|
} else {
|
|
37
|
-
status = run("bash", [path.join(installRoot, "burnboard-setup.sh"), name, server]);
|
|
37
|
+
status = run("bash", [path.join(installRoot, "burnboard-setup.sh"), name, server, mode]);
|
|
38
38
|
}
|
|
39
39
|
if (status === 0) {
|
|
40
40
|
fs.writeFileSync(installedVersionPath, `${cliVersion}\n`);
|
|
@@ -53,7 +53,7 @@ async function connect() {
|
|
|
53
53
|
if (!response.ok) throw new Error(body.error || "The connection code could not be used.");
|
|
54
54
|
fs.mkdirSync(burnboardRoot, { recursive:true });
|
|
55
55
|
fs.writeFileSync(path.join(burnboardRoot, "config.json"), `${JSON.stringify({ serverUrl:server, token:body.token, profileUrl:body.profileUrl }, null, 2)}\n`);
|
|
56
|
-
if (setup("Connected BurnBoard User") !== 0) throw new Error("Connected, but the local tracker could not be installed. Run
|
|
56
|
+
if (setup("Connected BurnBoard User", "connect") !== 0) throw new Error("Connected, but the local tracker could not be installed. Run `npx --yes burnboard-cli@latest update --force` to repair it.");
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
function update() {
|
|
@@ -73,7 +73,7 @@ function update() {
|
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
console.log(`Updating BurnBoard from ${installedVersion || "a legacy installation"} to ${cliVersion}...`);
|
|
76
|
-
if (setup("Existing BurnBoard User") !== 0) throw new Error("The update did not complete successfully; the existing tracker is unchanged.");
|
|
76
|
+
if (setup("Existing BurnBoard User", "update") !== 0) throw new Error("The update did not complete successfully; the existing tracker is unchanged.");
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
function sync() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set -euo pipefail
|
|
3
|
-
NAME="${1:?Usage: burnboard-setup.sh NAME [SERVER_URL]}"; SERVER_URL="${2:-https://burnboard-public.vercel.app}"
|
|
3
|
+
NAME="${1:?Usage: burnboard-setup.sh NAME [SERVER_URL]}"; SERVER_URL="${2:-https://burnboard-public.vercel.app}"; MODE="${3:-setup}"
|
|
4
4
|
command -v node >/dev/null || { echo "Node.js is required." >&2; exit 1; }
|
|
5
5
|
INSTALL_DIR="$HOME/.burnboard"; CONFIG="$INSTALL_DIR/config.json"; mkdir -p "$INSTALL_DIR" "$HOME/.claude"
|
|
6
6
|
printf '[1/5] Preparing BurnBoard profile...\n'
|
|
@@ -87,7 +87,18 @@ X-GNOME-Autostart-enabled=true
|
|
|
87
87
|
EOF
|
|
88
88
|
SCHEDULER="portable background service"
|
|
89
89
|
fi
|
|
90
|
-
if [[ "$(uname -s)" == "Darwin" ]] && ! pgrep -x Antigravity >/dev/null 2>&1 && [[ -d "/Applications/Antigravity.app" ]]; then open -a Antigravity; sleep 8; fi
|
|
90
|
+
if [[ "$MODE" != "update" ]] && [[ "$(uname -s)" == "Darwin" ]] && ! pgrep -x Antigravity >/dev/null 2>&1 && [[ -d "/Applications/Antigravity.app" ]]; then open -a Antigravity; sleep 8; fi
|
|
91
|
+
if [[ "$MODE" != "update" ]] && [[ "$(uname -s)" == "Linux" ]] && ! pgrep -if 'antigravity' >/dev/null 2>&1; then
|
|
92
|
+
ANTIGRAVITY_BIN=""
|
|
93
|
+
for candidate in antigravity antigravity-ide Antigravity; do if command -v "$candidate" >/dev/null 2>&1; then ANTIGRAVITY_BIN="$(command -v "$candidate")"; break; fi; done
|
|
94
|
+
if [[ -n "$ANTIGRAVITY_BIN" ]]; then
|
|
95
|
+
printf 'Starting Antigravity so its local usage service is available...\n'
|
|
96
|
+
nohup "$ANTIGRAVITY_BIN" >/dev/null 2>&1 </dev/null &
|
|
97
|
+
sleep 10
|
|
98
|
+
else
|
|
99
|
+
printf 'Antigravity launcher was not found on PATH. Open Antigravity once, then run: npx --yes burnboard-cli sync\n'
|
|
100
|
+
fi
|
|
101
|
+
fi
|
|
91
102
|
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=$!
|
|
92
103
|
while kill -0 "$PID" 2>/dev/null; do printf '.'; sleep 1; done
|
|
93
104
|
if ! wait "$PID"; then printf '\n'; cat "$ERR" >&2; rm -f "$OUT" "$ERR"; exit 1; fi
|