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.
- package/dist/index.js +12 -13
- 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 {
|
|
137
|
+
import { exec } from "child_process";
|
|
138
138
|
import chalk from "chalk";
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
function run(cmd) {
|
|
140
|
+
return new Promise((resolve) => {
|
|
141
|
+
exec(cmd, (err) => resolve(!err));
|
|
142
142
|
});
|
|
143
|
-
|
|
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
|
-
|
|
146
|
-
|
|
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
|
|
152
|
-
console.log(chalk.
|
|
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.
|
|
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);
|