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:
3
core.go
3
core.go
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user