Skip to content

Commit 80c451c

Browse files
committed
setup: ensure we rename bundles db correctly and check that it exists
Signed-off-by: Morten Linderud <[email protected]>
1 parent bfdefcf commit 80c451c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cmd/sbctl/setup.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,10 @@ func MigrateSetup(state *config.State) error {
190190
if err := state.Fs.Rename(path.Join(p, "files.db"), newConf.FilesDb); err != nil {
191191
return err
192192
}
193-
if err := state.Fs.Rename(path.Join(p, "bundles.db"), newConf.FilesDb); err != nil {
194-
return err
193+
if ok, _ := afero.Exists(state.Fs, path.Join(p, "bundles.db")); ok {
194+
if err := state.Fs.Rename(path.Join(p, "bundles.db"), newConf.BundlesDb); err != nil {
195+
return err
196+
}
195197
}
196198
logging.Ok("")
197199

0 commit comments

Comments
 (0)