@verikit/cli 0.1.0 → 0.2.0
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 +7 -1
- package/package.json +5 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
+
import { realpathSync } from "node:fs";
|
|
3
4
|
import { pathToFileURL } from "node:url";
|
|
4
5
|
import { InitAbort, runInit } from "./commands/init.js";
|
|
5
6
|
/**
|
|
@@ -39,8 +40,13 @@ export function createProgram(run = runInit) {
|
|
|
39
40
|
return program;
|
|
40
41
|
}
|
|
41
42
|
/* node:coverage disable */
|
|
43
|
+
// `process.argv[1]` is the path used to invoke this script when run through npm/npx's `bin`
|
|
44
|
+
// symlink (node_modules/.bin/verikit -> .../dist/index.js), that's the symlink path, while
|
|
45
|
+
// `import.meta.url` is Node's ESM loader resolving to the real, symlink-followed path. Without
|
|
46
|
+
// realpathSync here the two never match, `isMain` is always false, and the CLI silently no-ops
|
|
47
|
+
// for every real install only direct `node dist/index.js` invocations happened to line up.
|
|
42
48
|
const isMain = typeof process.argv[1] === "string" &&
|
|
43
|
-
import.meta.url === pathToFileURL(process.argv[1]).href;
|
|
49
|
+
import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href;
|
|
44
50
|
if (isMain) {
|
|
45
51
|
void createProgram().parseAsync(process.argv);
|
|
46
52
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verikit/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Scaffolding CLI for VeriKit detects your stack, installs the right packages, and wires up the integration.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/verikit-project/verikit-cli.git"
|
|
8
|
+
},
|
|
5
9
|
"type": "module",
|
|
6
10
|
"license": "MIT",
|
|
7
11
|
"author": "Chidi E <hi@ceeso.dev>",
|