Skip to content

Commit

Permalink
fix(cache): write on CLI commands
Browse files Browse the repository at this point in the history
  • Loading branch information
JanDeDobbeleer committed Sep 19, 2024
1 parent 3114666 commit 6c13aaf
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/cli/enable.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@ func init() {
func toggleFeature(cmd *cobra.Command, feature string, enable bool) {
env := &runtime.Terminal{
CmdFlags: &runtime.Flags{
Shell: shellName,
Shell: shellName,
SaveCache: true,
},
}

env.Init()
defer env.Close()

switch feature {
case "notice":
if enable {
Expand Down
7 changes: 6 additions & 1 deletion src/cli/font.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
5 changes: 4 additions & 1 deletion src/cli/notice.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
8 changes: 7 additions & 1 deletion src/cli/toggle.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
1 change: 1 addition & 0 deletions src/upgrade/notice.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6c13aaf

Please sign in to comment.