Closed RaverJay closed 6 years ago
Hey,
I indeed assumed that the user would always supply "non critical" paths for the tmpdir, and thus didn't take this case into account. Thanks for warning me, and for the set -e tip.
Pushing the modified script and a few updates on the algorithm later today.
Cheers, P
A bit late, but just pushed the updates. Closing the issue.
Cheers, P
Hey, your bash script has a major safety flaw in that it will delete the tmpdir without caring what it is. What if someone were to supply '.' or '~' as the --tmpdir parameter?
You really need to change it so it makes a new folder inside the supplied path and only deletes that after completion.
Another thing is that as per default bash behavior, your script will continue even if intermediate steps fail, even if that makes no sense at all. It thus always arrives at the dangerous rm -Rf command...
So I would advise to set -e in the beginning to change bash behavior to stop on a failed command.
Cheers