[Bug]: Backup not created if .trash is empty
See original GitHub issueBug Description
Thanks for the amazing workflow! When I run the obackup
command, if my $vault_path/.trash
folder is empty, the backup command will appear to run, but no backup is created. If the $vault_path/.trash
folder is not empty, the backup is created successfully.
I believe the problem is line 16 of scripts/obsidian-backup.sh
: if [[ "$itemCount" != "0" ]] ; then
. It appears to evaluate to “true” even when the .trash
folder is empty. When I changed line 16 to if (( ${itemCount} != 0 )) ; then
, the backup worked correctly both when .trash
was empty and when it had items in it.
Relevant Screenshot
No response
To Reproduce
No response
Debugging Log
[14:11:33.988] Shimmering Obsidian[Script Filter] Queuing argument ‘(null)’ [14:11:34.746] Shimmering Obsidian[Keyword] Processing complete [14:11:34.762] Shimmering Obsidian[Keyword] Passing output ‘’ to Post Notification [14:11:34.763] Shimmering Obsidian[Post Notification] Processing complete [14:11:34.764] Shimmering Obsidian[Post Notification] Passing output ‘’ to Run Script [14:11:34.848] STDERR: Shimmering Obsidian[Run Script] mkdir: /Users/christyray/Library/Mobile Documents/iCloud~md~obsidian/Documents/Notes/.trash: File exists /Users/christyray/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.67A5BC3A-139E-46C4-A1F2-E42D30566510/scripts/obsidian-backup.sh:17: no matches found: ./.trash/* [14:11:34.867] Shimmering Obsidian[Run Script] Processing complete [14:11:34.869] Shimmering Obsidian[Run Script] Passing output '/Users/christyray/Scripts/Obsidian-Backup/Obsidian-Backup_2022-02-04_14-11.zip ’ to Post Notification [14:11:34.870] Shimmering Obsidian[Post Notification] Processing complete [14:11:34.871] Shimmering Obsidian[Post Notification] Passing output '/Users/christyray/Scripts/Obsidian-Backup/Obsidian-Backup_2022-02-04_14-11.zip ’ to Play Sound [14:11:34.942] Shimmering Obsidian[Play Sound] Processing complete [14:11:34.957] Shimmering Obsidian[Play Sound] Passing output '/Users/christyray/Scripts/Obsidian-Backup/Obsidian-Backup_2022-02-04_14-11.zip ’ to Call External Trigger [14:11:34.958] Shimmering Obsidian[External] Processing complete [14:11:34.959] Shimmering Obsidian[External] Passing output '/Users/christyray/Scripts/Obsidian-Backup/Obsidian-Backup_2022-02-04_14-11.zip ’ to Conditional [14:11:34.961] Shimmering Obsidian[Conditional] Processing complete [14:11:34.962] Shimmering Obsidian[Conditional] Passing output '/Users/christyray/Scripts/Obsidian-Backup/Obsidian-Backup_2022-02-04_14-11.zip ’ to Run Script
Workflow Configuration
The ends of some of the paths are cut off, but I don’t believe they are part of the issue.
Version & System Information
-------------------------------
Metadata JSONs: 3/3
-------------------------------
INSTALLED VERSION
macOS: 12.1
Obsidian: 0.13.24
Alfred: 4.6.2
Workflow: 2.20.1
Advanced URI Plugin: 1.17.0
Metadata Extractor: 0.3.1
-------------------------------
LATEST VERSION
Obsidian: 0.13.23
Obsidian (Insider): 0.13.24
Workflow: 2.20.2
Advanced URI Plugin: 1.17.0
Metadata Extractor: 0.3.1
-------------------------------
Make sure you have done the following
- I have updated to the latest version of this workflow.
- I have read the Troubleshooting Documentation.
- If the
o ...
main search does not work, I have tried rerunningosetup
and it still does not work.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
okay, I tried some workaround in release 2.20.4, which should hopefully update the keyword properly (also closing this, since the original bug has been resolved, thanks again for fixing it!)
I changed the keyword for that one, I think it’s some sort of bug for Alfred, that changes in keywords do not get updated properly sometimes 🙁 If you uninstall the workflow and do a clean install (instead of installing the newest version while you have the workflow already installed), it gets updated properly. I’ll look into whether I can maybe find a workaround for that…