mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-09-19 21:17:31 -07:00
fix(cache): write on CLI commands
This commit is contained in:
parent
3114666a25
commit
6c13aaf0ef
|
@ -44,11 +44,14 @@ func init() {
|
||||||
func toggleFeature(cmd *cobra.Command, feature string, enable bool) {
|
func toggleFeature(cmd *cobra.Command, feature string, enable bool) {
|
||||||
env := &runtime.Terminal{
|
env := &runtime.Terminal{
|
||||||
CmdFlags: &runtime.Flags{
|
CmdFlags: &runtime.Flags{
|
||||||
Shell: shellName,
|
Shell: shellName,
|
||||||
|
SaveCache: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
env.Init()
|
env.Init()
|
||||||
defer env.Close()
|
defer env.Close()
|
||||||
|
|
||||||
switch feature {
|
switch feature {
|
||||||
case "notice":
|
case "notice":
|
||||||
if enable {
|
if enable {
|
||||||
|
|
|
@ -36,7 +36,12 @@ This command is used to install fonts and configure the font in your terminal.
|
||||||
fontName = args[1]
|
fontName = args[1]
|
||||||
}
|
}
|
||||||
|
|
||||||
env := &runtime.Terminal{}
|
env := &runtime.Terminal{
|
||||||
|
CmdFlags: &runtime.Flags{
|
||||||
|
SaveCache: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
env.Init()
|
env.Init()
|
||||||
defer env.Close()
|
defer env.Close()
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,11 @@ var noticeCmd = &cobra.Command{
|
||||||
Args: cobra.NoArgs,
|
Args: cobra.NoArgs,
|
||||||
Run: func(_ *cobra.Command, _ []string) {
|
Run: func(_ *cobra.Command, _ []string) {
|
||||||
env := &runtime.Terminal{
|
env := &runtime.Terminal{
|
||||||
CmdFlags: &runtime.Flags{},
|
CmdFlags: &runtime.Flags{
|
||||||
|
SaveCache: true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
env.Init()
|
env.Init()
|
||||||
defer env.Close()
|
defer env.Close()
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,13 @@ var toggleCmd = &cobra.Command{
|
||||||
_ = cmd.Help()
|
_ = cmd.Help()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
env := &runtime.Terminal{}
|
|
||||||
|
env := &runtime.Terminal{
|
||||||
|
CmdFlags: &runtime.Flags{
|
||||||
|
SaveCache: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
env.Init()
|
env.Init()
|
||||||
defer env.Close()
|
defer env.Close()
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ func Latest(env runtime.Environment) (string, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
var release release
|
var release release
|
||||||
// this can't fail
|
// this can't fail
|
||||||
_ = json.Unmarshal(body, &release)
|
_ = json.Unmarshal(body, &release)
|
||||||
|
|
Loading…
Reference in a new issue