File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
src/main/kotlin/com/github/oldmegit/goframehelper/listener Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ pluginSinceBuild = 222
12
12
13
13
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
14
14
platformType = GO
15
- platformVersion = 2024.2
15
+ platformVersion = LATEST-EAP-SNAPSHOT
16
16
17
17
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
18
18
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
Original file line number Diff line number Diff line change @@ -46,19 +46,20 @@ class Listener(private val project: Project): BulkFileListener {
46
46
return
47
47
}
48
48
49
+ val workDir = project.basePath
50
+
49
51
// exec command based on different systems
50
52
val os = System .getProperty(" os.name" ).lowercase(Locale .getDefault())
51
- val process = if (os.contains(" windows" )) {
52
- Runtime .getRuntime().exec(commandRaw, null , File (project.basePath.toString()) )
53
+ val command = if (os.contains(" windows" )) {
54
+ arrayOf( " cmd " , " /c " , " cd $workDir && $commandRaw " )
53
55
} else if (os.contains(" linux" ) || os.contains(" mac" )) {
54
- val workDir = project.basePath
55
- val command = arrayOf(" sh" , " -c" , " cd $workDir && $commandRaw " )
56
- ProcessBuilder (* command).start()
56
+ arrayOf(" sh" , " -c" , " cd $workDir && $commandRaw " )
57
57
} else {
58
58
Notification .message(project, Bundle .getMessage(" fileWatch.NotSupport" ))
59
59
return
60
60
}
61
61
62
+ val process = ProcessBuilder (* command).start()
62
63
val code = process.waitFor()
63
64
if (code != 0 ) {
64
65
throw Exception (code.toString())
You can’t perform that action at this time.
0 commit comments