Skip to content

Commit 00cd789

Browse files
committed
fix: use rimraf for deleting the temp folder
1 parent 82f708a commit 00cd789

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

lib/grammar-utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import os from "os"
55
import * as fs from "fs"
66
import path from "path"
77
import * as temp from "temp"
8-
temp.track()
8+
import * as rimraf from "rimraf"
99

1010
// Public: GrammarUtils - utilities for determining how to run code
1111
const GrammarUtils = {
@@ -54,9 +54,9 @@ const GrammarUtils = {
5454
// {GrammarUtils::createTempFileWithCode}
5555
deleteTempFiles() {
5656
try {
57-
return temp.cleanupSync()
57+
rimraf.sync(this.tempFilesDir)
5858
} catch (error) {
59-
throw new Error(`Error while deleting temporary files (${error})`)
59+
console.error(`Error while deleting temporary files (${error})`)
6060
}
6161
},
6262

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"ansi-to-html": "^0.6.14",
2727
"atom-message-panel": "1.3.1",
2828
"atom-space-pen-views-plus": "^3.0.4",
29+
"rimraf": "^3.0.2",
2930
"strip-ansi": "^6.0.0",
3031
"temp": "^0.9.4",
3132
"underscore": "^1.12.1",
@@ -38,6 +39,7 @@
3839
"@types/atom": "^1.40.10",
3940
"@types/jasmine": "^3.6.7",
4041
"@types/node": "^14.14.35",
42+
"@types/rimraf": "^3.0.0",
4143
"@types/temp": "^0.8.34",
4244
"@types/underscore": "^1.11.0",
4345
"@types/uuid": "^8.3.0",

pnpm-lock.yaml

Lines changed: 22 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)