mirror of
https://github.com/natelandau/shell-scripting-templates.git
synced 2025-11-09 13:43:46 -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
|
# Usage: Add this function at the end of every script
|
||||||
function safeExit() {
|
function safeExit() {
|
||||||
# Delete temp files, if any
|
# Delete temp files, if any
|
||||||
if is_not_empty "${tmpDir}"; then
|
if is_dir "${tmpDir}"; then
|
||||||
if is_dir "${tmpDir}"; then
|
rm -r "${tmpDir}"
|
||||||
rm -r "${tmpDir}"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
trap - INT TERM EXIT
|
trap - INT TERM EXIT
|
||||||
exit
|
exit
|
||||||
|
|||||||
Reference in New Issue
Block a user