From fc191d5b3c170d976c32de84fef56743970219cd Mon Sep 17 00:00:00 2001 From: root Date: Thu, 13 Dec 2012 21:02:14 +0400 Subject: Use a function for cleanup at exit --- git-remote-gcrypt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/git-remote-gcrypt b/git-remote-gcrypt index 3db71d5..b22503d 100755 --- a/git-remote-gcrypt +++ b/git-remote-gcrypt @@ -761,12 +761,17 @@ EOF echo_git } +cleanup_atexit() +{ + rm -f "$Localdir"/tmp_*".$$" >&2 +} + NAME=$1 # Remote name URL=$2 # Remote URL mkdir -p "$Localdir" +trap cleanup_atexit EXIT 1 2 3 15 -trap 'rm -f "$Localdir/tmp_"*".$$"' EXIT 1 2 3 15 echo_info "Development version -- Repository format MAY CHANGE" while read Input -- cgit v1.1