npm-groovy-lint 14.2.2 → 14.2.3
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/groovy-lint.js +6 -0
- package/package.json +1 -1
package/lib/groovy-lint.js
CHANGED
|
@@ -3,6 +3,7 @@ const debug = require("debug")("npm-groovy-lint");
|
|
|
3
3
|
const trace = require("debug")("npm-groovy-lint-trace");
|
|
4
4
|
const fs = require("fs-extra");
|
|
5
5
|
const os = require("os");
|
|
6
|
+
const path = require("path");
|
|
6
7
|
const performance = require("perf_hooks").performance;
|
|
7
8
|
|
|
8
9
|
const NpmGroovyLintFix = require("./groovy-lint-fix");
|
|
@@ -109,6 +110,11 @@ class NpmGroovyLint {
|
|
|
109
110
|
|
|
110
111
|
await fs.remove(this.tmpGroovyFileName);
|
|
111
112
|
debug(`Removed temp file ${this.tmpGroovyFileName} as it is not longer used :)`);
|
|
113
|
+
const tmpDir = path.dirname(this.tmpGroovyFileName);
|
|
114
|
+
if (tmpDir.includes("codeNarcTmpDir_") && fs.readdirSync(tmpDir).length === 0) {
|
|
115
|
+
await fs.remove(tmpDir);
|
|
116
|
+
debug(`Removed temp dir ${tmpDir} as it is not longer used :)`);
|
|
117
|
+
}
|
|
112
118
|
this.tmpGroovyFileName = null;
|
|
113
119
|
}
|
|
114
120
|
|