@scrymore/scry-deployer 0.2.0 → 0.2.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/lib/coverage.js +14 -1
- package/package.json +1 -1
package/lib/coverage.js
CHANGED
|
@@ -81,7 +81,20 @@ async function runCoverageAnalysis(options) {
|
|
|
81
81
|
// Allow local override for E2E testing before package publication.
|
|
82
82
|
// Example:
|
|
83
83
|
// SCRY_SBCOV_CMD="node /abs/path/to/scry-sbcov/dist/cli/index.js"
|
|
84
|
-
|
|
84
|
+
//
|
|
85
|
+
// Default: resolve the CLI from the installed dependency to avoid npx cache
|
|
86
|
+
// issues where `npx -y` might resolve a stale older version.
|
|
87
|
+
let defaultSbcovCmd = 'npx -y @scrymore/scry-sbcov';
|
|
88
|
+
try {
|
|
89
|
+
const sbcovCli = require.resolve('@scrymore/scry-sbcov/dist/cli/index.js');
|
|
90
|
+
defaultSbcovCmd = `node ${shellEscape(sbcovCli)}`;
|
|
91
|
+
} catch (error) {
|
|
92
|
+
// Fall back to npx if resolve fails (e.g. not installed as dependency)
|
|
93
|
+
if (error.code !== 'MODULE_NOT_FOUND') {
|
|
94
|
+
console.warn('[scry-deployer] Unexpected error resolving @scrymore/scry-sbcov, falling back to npx:', error);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const sbcovCommandPrefix = (process.env.SCRY_SBCOV_CMD || defaultSbcovCmd).trim();
|
|
85
98
|
const npxCommand = `${sbcovCommandPrefix} ${cliArgs.map(shellEscape).join(' ')}`;
|
|
86
99
|
|
|
87
100
|
// Debug logging to show the exact command being executed
|