burnboard-cli 0.2.1 → 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.
Files changed (2) hide show
  1. package/cli.mjs +3 -3
  2. 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"), lastCheck = fs.existsSync(lastUpdateCheckPath) ? Date.parse(fs.readFileSync(lastUpdateCheckPath, "utf8").trim()) : 0;
52
- if (!force && Number.isFinite(lastCheck) && Date.now() - lastCheck < 20 * 60 * 60 * 1000) {
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}).`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "burnboard-cli",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Connect local AI coding token usage to BurnBoard",
5
5
  "type": "module",
6
6
  "bin": {