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
|
@ -45,10 +45,13 @@ func toggleFeature(cmd *cobra.Command, feature string, enable bool) {
|
|||
env := &runtime.Terminal{
|
||||
CmdFlags: &runtime.Flags{
|
||||
Shell: shellName,
|
||||
SaveCache: true,
|
||||
},
|
||||
}
|
||||
|
||||
env.Init()
|
||||
defer env.Close()
|
||||
|
||||
switch feature {
|
||||
case "notice":
|
||||
if enable {
|
||||
|
|
|
@ -36,7 +36,12 @@ This command is used to install fonts and configure the font in your terminal.
|
|||
fontName = args[1]
|
||||
}
|
||||
|
||||
env := &runtime.Terminal{}
|
||||
env := &runtime.Terminal{
|
||||
CmdFlags: &runtime.Flags{
|
||||
SaveCache: true,
|
||||
},
|
||||
}
|
||||
|
||||
env.Init()
|
||||
defer env.Close()
|
||||
|
||||
|
|
|
@ -16,8 +16,11 @@ var noticeCmd = &cobra.Command{
|
|||
Args: cobra.NoArgs,
|
||||
Run: func(_ *cobra.Command, _ []string) {
|
||||
env := &runtime.Terminal{
|
||||
CmdFlags: &runtime.Flags{},
|
||||
CmdFlags: &runtime.Flags{
|
||||
SaveCache: true,
|
||||
},
|
||||
}
|
||||
|
||||
env.Init()
|
||||
defer env.Close()
|
||||
|
||||
|
|
|
@ -19,7 +19,13 @@ var toggleCmd = &cobra.Command{
|
|||
_ = cmd.Help()
|
||||
return
|
||||
}
|
||||
env := &runtime.Terminal{}
|
||||
|
||||
env := &runtime.Terminal{
|
||||
CmdFlags: &runtime.Flags{
|
||||
SaveCache: true,
|
||||
},
|
||||
}
|
||||
|
||||
env.Init()
|
||||
defer env.Close()
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ func Latest(env runtime.Environment) (string, error) {
|
|||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
var release release
|
||||
// this can't fail
|
||||
_ = json.Unmarshal(body, &release)
|
||||
|
|
Loading…
Reference in a new issue