create-specfuse 0.9.0 → 0.9.1
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 +16 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from 'commander';
|
|
3
|
-
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { readFileSync, realpathSync } from 'node:fs';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import { dirname, resolve } from 'node:path';
|
|
6
6
|
import { collectProjectConfig } from './prompts.js';
|
|
@@ -25,8 +25,21 @@ program
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
// Only parse when run as the CLI entrypoint, so tests can import `program`.
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
// npm/npx invoke this file through a symlink (node_modules/.bin/create-specfuse),
|
|
29
|
+
// so argv[1] must be realpath'd before comparison — comparing the raw path makes
|
|
30
|
+
// every symlinked invocation look like an import and the CLI silently no-ops.
|
|
31
|
+
function isEntrypoint() {
|
|
32
|
+
const invoked = process.argv[1];
|
|
33
|
+
if (!invoked)
|
|
34
|
+
return false;
|
|
35
|
+
try {
|
|
36
|
+
return realpathSync(fileURLToPath(import.meta.url)) === realpathSync(resolve(invoked));
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (isEntrypoint()) {
|
|
30
43
|
program.parse();
|
|
31
44
|
}
|
|
32
45
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM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