Skip to content

Commit

Permalink
added signal handler to cleanup at user break
Browse files Browse the repository at this point in the history
  • Loading branch information
neteler committed Nov 24, 2024
1 parent 7524c52 commit 8ccc15d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions utils/grass_html2md.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ set -eu
#
###############################################################################

# cleanup at user break
cleanup()
{
rm -f "${f%%.html}_tmp.html"
}

# what to do in case of user break:
exitprocedure()
{
echo "User break!"
cleanup
exit 1
}
# shell check for user break (signal list: trap -l)
trap "exitprocedure" 2 3 15

# path to LUA file (./utils/pandoc_codeblock.lua)
UTILSPATH="utils"

Expand Down

0 comments on commit 8ccc15d

Please sign in to comment.