Skip to content

Commit b382f2f

Browse files
authored
Close File Watch when gf-cli not available (#8)
1 parent 8369bdc commit b382f2f

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

src/main/kotlin/com/github/oldmegit/goframehelper/listener/Listener.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package com.github.oldmegit.goframehelper.listener
33
import com.github.oldmegit.goframehelper.data.Bundle
44
import com.github.oldmegit.goframehelper.gf.Gf
55
import com.github.oldmegit.goframehelper.gf.GfGoMod
6+
import com.github.oldmegit.goframehelper.ui.AppSettingsState
67
import com.goide.GoFileType
78
import com.intellij.openapi.project.Project
89
import com.intellij.openapi.vfs.newvfs.BulkFileListener
@@ -37,6 +38,10 @@ class Listener(private val project: Project): BulkFileListener {
3738
}
3839
} catch (_: Exception) {
3940
val message = Bundle.getMessage("gfExecErrNotify")
41+
val settings = AppSettingsState.getInstance(project)
42+
settings.gfEnableApiWatch = false
43+
settings.gfEnableLogicWatch = false
44+
4045
NotificationGroupManager.getInstance()
4146
.getNotificationGroup("GoFrame Help Notify")
4247
.createNotification(message, NotificationType.INFORMATION)
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name=GoFrame Helper
2-
init=Init GoFrame Helper
1+
name = GoFrame Helper
2+
init = Init GoFrame Helper
33

44
# setting window
5-
setting.api.src=Api src folder:
6-
setting.logic.src=Logic src folder:
7-
setting.custom.gfCli=custom gf-cli:
8-
setting.api.watch=Enable Api watch, it will auto exec `gf gen ctrl`
9-
setting.service.watch=Enable Service watch, it will auto exec `gf gen service`
5+
setting.api.src = Api src folder:
6+
setting.logic.src = Logic src folder:
7+
setting.custom.gfCli = custom gf-cli:
8+
setting.api.watch = Enable Api watch, it will auto exec `gf gen ctrl`
9+
setting.service.watch = Enable Service watch, it will auto exec `gf gen service`
1010

11-
gfExecErrNotify=Please check if gf-cli is available.
11+
gfExecErrNotify = gf-cli is not available, auto closing File Watch. You can re-enable it in Setting-Tools-GoFrame Helper.
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name=GoFrame Helper
2-
init=\u521d\u59cb\u5316 GoFrame Helper
1+
name = GoFrame Helper
2+
init = \u521d\u59cb\u5316 GoFrame Helper
33

44
# setting window
5-
setting.api.src=Api \u76ee\u5f55:
6-
setting.logic.src=Logic \u76ee\u5f55:
7-
setting.custom.gfCli=\u81ea\u5b9a\u4e49 gf-cli
8-
setting.api.watch=\u542f\u7528 Api watch, \u5b83\u4f1a\u81ea\u52a8\u6267\u884c `gf gen ctrl`
9-
setting.service.watch=\u542f\u7528 Service watch, \u5b83\u4f1a\u81ea\u52a8\u6267\u884c `gf gen service`
5+
setting.api.src = Api \u76ee\u5f55:
6+
setting.logic.src = Logic \u76ee\u5f55:
7+
setting.custom.gfCli = \u81ea\u5b9a\u4e49 gf-cli
8+
setting.api.watch = \u542f\u7528 Api watch, \u5b83\u4f1a\u81ea\u52a8\u6267\u884c `gf gen ctrl`
9+
setting.service.watch = \u542f\u7528 Service watch, \u5b83\u4f1a\u81ea\u52a8\u6267\u884c `gf gen service`
1010

11-
gfExecErrNotify=\u8bf7\u68c0\u67e5 gf-cli \u5de5\u5177\u662f\u5426\u53ef\u7528
11+
gfExecErrNotify = \u0067\u0066\u002d\u0063\u006c\u0069\u0020\u4e0d\u53ef\u7528\uff0c\u5c06\u81ea\u52a8\u5173\u95ed\u0020\u0046\u0049\u006c\u0065\u0020\u0057\u0061\u0074\u0063\u0068\uff0c\u60a8\u53ef\u4ee5\u5728\u0020\u0053\u0065\u0074\u0074\u0069\u006e\u0067\u002d\u0054\u006f\u006f\u006c\u0073\u002d\u0047\u006f\u0046\u0072\u0061\u006d\u0065\u0020\u0048\u0065\u006c\u0070\u0065\u0072\u0020\u4e2d\u91cd\u65b0\u542f\u7528\u3002

0 commit comments

Comments
 (0)