Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix DB path

Neeraj Gupta5d4c14a5d594
diff --git a/main.go b/main.go
index 6424aea403..2147afde91 100644
--- a/main.go
+++ b/main.go
@@ -27,12 +27,14 @@ func main() {
if err != nil {
log.Fatalf("Could not create cli config path\n%v\n", err)
}
- oldCliPath := fmt.Sprintf("%sente-cli.db", cliDBPath)
newCliPath := fmt.Sprintf("%s/ente-cli.db", cliDBPath)
- if _, err := os.Stat(oldCliPath); err == nil {
- log.Printf("migrating old cli db from %s to %s\n", oldCliPath, newCliPath)
- if err := os.Rename(oldCliPath, newCliPath); err != nil {
- log.Fatalf("Could not rename old cli db\n%v\n", err)
+ if !strings.HasPrefix(cliDBPath, "/") {
+ oldCliPath := fmt.Sprintf("%sente-cli.db", cliDBPath)
+ if _, err := os.Stat(oldCliPath); err == nil {
+ log.Printf("migrating old cli db from %s to %s\n", oldCliPath, newCliPath)
+ if err := os.Rename(oldCliPath, newCliPath); err != nil {
+ log.Fatalf("Could not rename old cli db\n%v\n", err)
+ }
}
}
db, err := pkg.GetDB(newCliPath)