mirror of
https://github.com/natelandau/shell-scripting-templates.git
synced 2025-11-09 05:33:48 -05:00
fixed problem removing temp directories in all circumstances
This commit is contained in:
@@ -20,10 +20,8 @@
|
||||
# Usage: Add this function at the end of every script
|
||||
function safeExit() {
|
||||
# Delete temp files, if any
|
||||
if is_not_empty "${tmpDir}"; then
|
||||
if is_dir "${tmpDir}"; then
|
||||
rm -r "${tmpDir}"
|
||||
fi
|
||||
if is_dir "${tmpDir}"; then
|
||||
rm -r "${tmpDir}"
|
||||
fi
|
||||
trap - INT TERM EXIT
|
||||
exit
|
||||
|
||||
Reference in New Issue
Block a user