1
0
mirror of https://github.com/vwxyzjn/portwarden synced 2025-12-15 23:43:16 +00:00

API-1 # Create the backup folder first

This fixes the bug that users without attachments will not be able to write to `./portwarden_backup/main.json`
This commit is contained in:
Costa Huang
2018-11-16 17:13:07 -05:00
parent 706afce3f6
commit 1f91de1dae

View File

@@ -78,6 +78,9 @@ func CreateBackupBytes(passphrase, sessionKey string, sleepMilliseconds int) ([]
if err := json.Unmarshal(rawByte, &pwes); err != nil {
return nil, err
}
if err = os.MkdirAll(BackupFolderName, os.ModePerm); err != nil {
return nil, err
}
err = BWGetAllAttachments(BackupFolderName, sessionKey, pwes, sleepMilliseconds)
if err != nil {
return nil, err