You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just had an oops moment when I misunderstood that the --output parameter requires a non-existing or empty folder.
I ran the following command:
poetry run icons-asset-generator \
--path ~/Downloads/affinity/svg \
--image-name-remove c sq \
--output ~/Desktop \
diagrams.net
I got an error message that the dir wasn't empty, and then the program aborted. To my surprise, my entire ~/Desktop directory had been nuked. Luckily I had a backup, but this could easily be catastrophic.
To my surprise, my entire ~/Desktop directory had been nuked. Luckily I had a backup, but this could easily be catastrophic.
Oh, that's bad! Sorry for that!
Yes, as you noted, the script is trying to remove and re-create the output dir. This is useful if you are fiddling with the parameters and want to have a fresh output every time, but in retrospective, I agree that's dangerous. And you can do rm -rf ./library && poetry run icons-asset-generator ... to clean the output dir consciously.
I think requiring a nonexisting or empty output location is reasonable. If you can put this into a PR, I'll be happy to change this.
I just had an oops moment when I misunderstood that the
--output
parameter requires a non-existing or empty folder.I ran the following command:
I got an error message that the dir wasn't empty, and then the program aborted. To my surprise, my entire
~/Desktop
directory had been nuked. Luckily I had a backup, but this could easily be catastrophic.I think this is the problematic code:
icons-asset-generator/icons_asset_generator/util/io.py
Lines 1 to 7 in dd0ed3e
Maybe a check for empty dir could be used instead (this is just an example)
The text was updated successfully, but these errors were encountered: