vwxyzjn / portwarden

Create Encrypted Backups of Your Bitwarden Vault with Attachments
MIT License
577 stars 33 forks source link

Runtime error when having bitwarden item with trailing spaces. #10

Closed vwxyzjn closed 5 years ago

vwxyzjn commented 5 years ago

bugreport Suppose the Bitwarden item name is House Purchase of 2001 Hamilton St Apt 1705 (Notice there is a trailing space)

    cmd := exec.Command("bw", "get", "attachment", attachmentID, "--itemid", itemID,
        "--session", sessionKey, "--output", outputDir)

will actually create a folder with that trailing space, but windows somehow don't recognize it once it's there, causing the following line to fail

err = archiver.Zip.Write(writer, []string{BackupFolderName})
// panic: portwarden_backup: stat: CreateFile portwarden_backup: The system cannot find the file specified.
vwxyzjn commented 5 years ago

Solved by #11