@samaksh/git-worker 0.3.0 → 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/dist/cli/index.js +12 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
+
import { createRequire } from "module";
|
|
3
4
|
import { run } from "../app.js";
|
|
4
5
|
import { handleCacheList, handleCacheClean } from "./commands.js";
|
|
5
6
|
import chalk from "chalk";
|
|
7
|
+
let version = "0.3.2";
|
|
8
|
+
try {
|
|
9
|
+
const require = createRequire(import.meta.url);
|
|
10
|
+
const pkg = require("../../package.json");
|
|
11
|
+
if (pkg?.version)
|
|
12
|
+
version = pkg.version;
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
// fallback
|
|
16
|
+
}
|
|
6
17
|
const program = new Command();
|
|
7
18
|
program
|
|
8
19
|
.name("git-worker")
|
|
9
20
|
.description("Safe, composable CLI/TUI for applying reviewed file changes across many Git branches")
|
|
10
|
-
.version(
|
|
21
|
+
.version(version)
|
|
11
22
|
.option("-r, --repo <path>", "Repository path or remote URL (default: current directory)")
|
|
12
23
|
.option("-c, --cached", "Select from previously cloned and cached repositories")
|
|
13
24
|
.option("-b, --branch <pattern>", "Branch pattern — glob (uat/*) or regex (/uat.*/)")
|
package/package.json
CHANGED