spinalcordtoolbox
spinalcordtoolbox copied to clipboard
`sct_download_data` deletes the contents of the output folder by default, which is dangerous when combined with `-o`
I wanted to download sct_example_data to my PWD, so I ran:
sct_download_data -d sct_example_data -o .
Which then proceeded to irreversibly delete everything in my PWD. :facepalm:
I should have used one of the two following syntaxes:
sct_download_data -d sct_example_data -o sct_example_data/
sct_download_data -d sct_example_data -o ./sct_example_data/
But we should maybe be a little more careful when running commands that delete everything within a directory, aha.
Yikes, that's a big issue yes!
oh gosh, good thing you tested this @joshuacwnewton (hopefully you were not at ~/ 😅 )
Thankfully I was just in ~/data (which is a folder I created in response to... ALSO deleting the data/ folder just a few days ago).
Because I had deleted everything once already, I was mostly starting fresh, so not much else was deleted. :laughing:
Closing this issue as a duplicate of #4562.