@@ -23,6 +23,7 @@ import (
23
23
"github.com/metacubex/mihomo/component/resolver"
24
24
SNI "github.com/metacubex/mihomo/component/sniffer"
25
25
"github.com/metacubex/mihomo/component/trie"
26
+ "github.com/metacubex/mihomo/component/updater"
26
27
"github.com/metacubex/mihomo/config"
27
28
C "github.com/metacubex/mihomo/constant"
28
29
"github.com/metacubex/mihomo/constant/features"
@@ -113,6 +114,7 @@ func ApplyConfig(cfg *config.Config, force bool) {
113
114
runtime .GC ()
114
115
tunnel .OnRunning ()
115
116
hcCompatibleProvider (cfg .Providers )
117
+ initExternalUI ()
116
118
117
119
log .SetLevel (cfg .General .LogLevel )
118
120
}
@@ -385,6 +387,18 @@ func updateTunnels(tunnels []LC.Tunnel) {
385
387
listener .PatchTunnel (tunnels , tunnel .Tunnel )
386
388
}
387
389
390
+ func initExternalUI () {
391
+ if updater .ExternalUIFolder != "" {
392
+ dirEntries , _ := os .ReadDir (updater .ExternalUIFolder )
393
+ if len (dirEntries ) > 0 {
394
+ log .Infoln ("UI already exists" )
395
+ } else {
396
+ log .Infoln ("UI not exists, downloading" )
397
+ updater .UpdateUI ()
398
+ }
399
+ }
400
+ }
401
+
388
402
func updateGeneral (general * config.General ) {
389
403
tunnel .SetMode (general .Mode )
390
404
tunnel .SetFindProcessMode (general .FindProcessMode )
0 commit comments