mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-02-21 02:55:37 -08:00
parent
26e277bf5f
commit
9e238adbb9
|
@ -91,5 +91,7 @@ func loadConfig(env runtime.Environment) *Config {
|
||||||
return Default(env, true)
|
return Default(env, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setDisableNotice(data, &cfg)
|
||||||
|
|
||||||
return &cfg
|
return &cfg
|
||||||
}
|
}
|
||||||
|
|
5
src/config/notice_default.go
Normal file
5
src/config/notice_default.go
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
//go:build !disablenotice
|
||||||
|
|
||||||
|
package config
|
||||||
|
|
||||||
|
func setDisableNotice(_ []byte, _ *Config) {}
|
15
src/config/notice_disable.go
Normal file
15
src/config/notice_disable.go
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
//go:build disablenotice
|
||||||
|
|
||||||
|
package config
|
||||||
|
|
||||||
|
import "bytes"
|
||||||
|
|
||||||
|
func setDisableNotice(stream []byte, cfg *Config) {
|
||||||
|
if !hasKeyInByteStream(stream, "disable_notice") {
|
||||||
|
cfg.DisableNotice = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func hasKeyInByteStream(data []byte, key string) bool {
|
||||||
|
return bytes.Contains(data, []byte(key))
|
||||||
|
}
|
|
@ -75,6 +75,7 @@ func (term *Terminal) Init() {
|
||||||
term.sessionCache = initCache(cache.SessionFileName)
|
term.sessionCache = initCache(cache.SessionFileName)
|
||||||
|
|
||||||
term.resolveConfigPath()
|
term.resolveConfigPath()
|
||||||
|
|
||||||
term.cmdCache = &cache.Command{
|
term.cmdCache = &cache.Command{
|
||||||
Commands: maps.NewConcurrent(),
|
Commands: maps.NewConcurrent(),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue