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 CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## UNRELEASED
4
4
 
5
+ ## [10.0.1] 2022-08-14
6
+
7
+ - Fix error when files sent as positional arguments ([#232](https://github.com/nvuillam/npm-groovy-lint/issues/232))
8
+
5
9
  ## [10.0.0] 2022-08-13
6
10
 
7
11
  - Core
@@ -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 relativePath = path.relative(process.cwd(), finalPattern).replace(/\\/gu, "/");
96
- fileList.push(relativePath);
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 = 1;
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
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-groovy-lint",
3
- "version": "10.0.0",
3
+ "version": "10.0.1",
4
4
  "description": "Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files",
5
5
  "main": "index.js",
6
6
  "scripts": {