npm-groovy-lint 10.0.0 → 10.0.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/CHANGELOG.md +4 -0
- package/lib/codenarc-factory.js +3 -2
- package/lib/index.js +5 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/lib/codenarc-factory.js
CHANGED
|
@@ -92,8 +92,9 @@ async function prepareCodeNarcCall(options) {
|
|
|
92
92
|
}
|
|
93
93
|
// Absolute or cwd - relative path file
|
|
94
94
|
if (fs.existsSync(finalPattern)) {
|
|
95
|
-
const
|
|
96
|
-
|
|
95
|
+
const absolutePath = path.resolve(finalPattern).replace(/\\/gu, "/");
|
|
96
|
+
const relativePath = path.relative(process.cwd(), path.resolve(finalPattern)).replace(/\\/gu, "/");
|
|
97
|
+
fileList.push(absolutePath);
|
|
97
98
|
finalPattern = "**/" + path.normalize(relativePath.replace(/[/\\]$/u, "")).replace(/\\/gu, "/");
|
|
98
99
|
}
|
|
99
100
|
// Relative with codeNardBaseDir
|
package/lib/index.js
CHANGED
|
@@ -13,6 +13,10 @@ const linter = new NpmGroovyLint(process.argv, { origin: "index" });
|
|
|
13
13
|
process.exitCode = linter.status;
|
|
14
14
|
} catch (err) {
|
|
15
15
|
console.error("Unexpected error: " + err.message + "\n" + err.stack);
|
|
16
|
-
process.exitCode =
|
|
16
|
+
process.exitCode = 2;
|
|
17
|
+
// Quit if called by CLI and not as a module
|
|
18
|
+
if (require.main === module) {
|
|
19
|
+
process.exit();
|
|
20
|
+
}
|
|
17
21
|
}
|
|
18
22
|
})();
|