From 5e8c1246ba435481bec999a437eedcbabd8d29c6 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Tue, 13 Nov 2018 09:23:45 +0100 Subject: [PATCH] chg: dev: trap should not be set up if only sourcing the file. --- bin/compose | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/compose b/bin/compose index 5d714f2..adb6141 100755 --- a/bin/compose +++ b/bin/compose @@ -117,7 +117,6 @@ clean_cache() { } -trap_add "EXIT" clean_cache usage="$exname SERVICE"' @@ -2623,8 +2622,13 @@ cached_wget() { } export -f cached_wget + [ "$SOURCED" ] && return 0 + +trap_add "EXIT" clean_cache + + # if [[ "$UID" != 0 ]]; then # die "'$exname' requires root permissions (for now). Please run as root." # fi