We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e7e8e59 commit 2760510Copy full SHA for 2760510
main.go
@@ -12,6 +12,7 @@ import (
12
"os/signal"
13
"os/user"
14
"path"
15
+ "strings"
16
17
"github.com/arduino/arduino-language-server/ls"
18
"github.com/arduino/arduino-language-server/streams"
@@ -22,6 +23,12 @@ import (
22
23
func main() {
24
if len(os.Args) > 1 && os.Args[1] == "remove-temp-files" {
25
for _, tmpFile := range os.Args[2:] {
26
+ // SAFETY CHECK
27
+ if !strings.Contains(tmpFile, "arduino-language-server") {
28
+ fmt.Println("Could not remove extraneous temp folder:", tmpFile)
29
+ os.Exit(1)
30
+ }
31
+
32
paths.New(tmpFile).RemoveAll()
33
}
34
return
0 commit comments