Skip to content

Commit

Permalink
setup: ensure we rename bundles db correctly and check that it exists
Browse files Browse the repository at this point in the history
Signed-off-by: Morten Linderud <[email protected]>
  • Loading branch information
Foxboron committed Jul 31, 2024
1 parent bfdefcf commit 80c451c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/sbctl/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,10 @@ func MigrateSetup(state *config.State) error {
if err := state.Fs.Rename(path.Join(p, "files.db"), newConf.FilesDb); err != nil {
return err
}
if err := state.Fs.Rename(path.Join(p, "bundles.db"), newConf.FilesDb); err != nil {
return err
if ok, _ := afero.Exists(state.Fs, path.Join(p, "bundles.db")); ok {
if err := state.Fs.Rename(path.Join(p, "bundles.db"), newConf.BundlesDb); err != nil {
return err
}
}
logging.Ok("")

Expand Down

0 comments on commit 80c451c

Please sign in to comment.