Skip to content

Commit

Permalink
small fix for when removing DB files
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktop committed Dec 29, 2017
1 parent 2bed033 commit b24c57f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Load a launchpad app layout from a YAML config file
- [ ] add ability to save/load JSON as well as YAML
- [x] fix issue where if no files for a folder are installed don't create that folder (might cause eventual DB coruption)
- [ ] add ability to org dock as well `dorg` ? :wink:
- [ ] backup current launchpad layout before changing

## Issues

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
17.12.7
17.12.8
8 changes: 5 additions & 3 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,12 @@ func removeOldDatabaseFiles(dbpath string) error {
}

for _, path := range paths {
if err := os.Remove(path); err != nil {
return errors.Wrap(err, "removing file failed")
if _, err := os.Stat(path); os.IsExist(err) {
if err := os.Remove(path); err != nil {
return errors.Wrap(err, "removing file failed")
}
utils.DoubleIndent(log.WithField("path", path).Info)("removed old file")
}
utils.DoubleIndent(log.WithField("path", path).Info)("removed old file")
}

return restartDock()
Expand Down

0 comments on commit b24c57f

Please sign in to comment.