Fixed CLI db path
This commit is contained in:
parent
d3c60b7f9d
commit
bb415850cb
1 changed files with 9 additions and 1 deletions
10
main.go
10
main.go
|
@ -19,7 +19,15 @@ func main() {
|
|||
if err != nil {
|
||||
log.Fatalf("Could not create cli config path\n%v\n", err)
|
||||
}
|
||||
db, err := pkg.GetDB(fmt.Sprintf("%sente-cli.db", cliDBPath))
|
||||
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)
|
||||
}
|
||||
}
|
||||
db, err := pkg.GetDB(newCliPath)
|
||||
if secrets.IsRunningInContainer() {
|
||||
cliDBPath = constants.CliDataPath
|
||||
_, err := internal.ValidateDirForWrite(cliDBPath)
|
||||
|
|
Loading…
Reference in a new issue