ccclub 0.1.2 → 0.1.3

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/dist/index.js +12 -13
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -134,22 +134,21 @@ async function installHeartbeat() {
134
134
  }
135
135
 
136
136
  // src/global-install.ts
137
- import { execFile as execFile2 } from "child_process";
137
+ import { exec } from "child_process";
138
138
  import chalk from "chalk";
139
- async function ensureGlobalInstall() {
140
- const isInstalled = await new Promise((resolve) => {
141
- execFile2("ccclub", ["--version"], (err) => resolve(!err));
139
+ function run(cmd) {
140
+ return new Promise((resolve) => {
141
+ exec(cmd, (err) => resolve(!err));
142
142
  });
143
- if (isInstalled) return;
143
+ }
144
+ async function ensureGlobalInstall() {
145
+ if (await run("ccclub --version")) return;
144
146
  console.log(chalk.dim("\n Installing ccclub globally so you can run it directly..."));
145
- const ok = await new Promise((resolve) => {
146
- execFile2("npm", ["install", "-g", "ccclub"], (err) => resolve(!err));
147
- });
148
- if (ok) {
149
- console.log(chalk.green(" \u2713 Installed!") + chalk.dim(" You can now use ") + chalk.white("ccclub rank") + chalk.dim(" directly."));
147
+ if (await run("npm install -g ccclub")) {
148
+ console.log(chalk.green(" Done!") + chalk.dim(" You can now use ") + chalk.white("ccclub rank") + chalk.dim(" directly."));
150
149
  } else {
151
- console.log(chalk.dim(" Could not install globally. You can do it manually:"));
152
- console.log(chalk.dim(" npm install -g ccclub"));
150
+ console.log(chalk.dim(" Could not auto-install. Run manually:"));
151
+ console.log(chalk.white(" npm install -g ccclub"));
153
152
  }
154
153
  }
155
154
 
@@ -659,7 +658,7 @@ async function createGroupCommand() {
659
658
 
660
659
  // src/index.ts
661
660
  var program = new Command();
662
- program.name("ccclub").description("CCClub - Compare Claude Code usage with friends").version("0.1.2");
661
+ program.name("ccclub").description("CCClub - Compare Claude Code usage with friends").version("0.1.3");
663
662
  program.command("init").description("Initialize CCClub (one-time setup)").action(initCommand);
664
663
  program.command("join").description("Join a friend's group").argument("<invite-code>", "6-character invite code").action(joinCommand);
665
664
  program.command("sync").description("Sync local usage data to server").option("-s, --silent", "No output (used by heartbeat)").action(syncCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccclub",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "description": "See how much Claude Code you and your friends are using",
6
6
  "bin": {