Skip to content

Commit

Permalink
rm func
Browse files Browse the repository at this point in the history
  • Loading branch information
kocubinski committed Oct 9, 2024
1 parent 2a5fd07 commit bcab586
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions server/v2/store/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ package store

import (
"fmt"
"os"
"path/filepath"
"strings"

"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down Expand Up @@ -89,20 +86,3 @@ func createRootStore(v *viper.Viper, logger log.Logger) (storev2.RootStore, root
}
return store, storeConfig.Options, nil
}

func overrideKeepRecent(configPath string, keepRecent uint64) error {
bz, err := os.ReadFile(filepath.Join(configPath, "app.toml"))
if err != nil {
return err
}
lines := strings.Split(string(bz), "\n")

for i, line := range lines {
if strings.Contains(line, "keep-recent") {
lines[i] = fmt.Sprintf("keep-recent = %d", keepRecent)
}
}
output := strings.Join(lines, "\n")

return os.WriteFile(filepath.Join(configPath, "app.toml"), []byte(output), 0o600)
}

0 comments on commit bcab586

Please sign in to comment.