From cf1a4a8d1de5cdc0112dcc5e72b120e4e42c3909 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 11 Sep 2017 03:12:15 -0400 Subject: [PATCH] fix: add missing TMPDIR variable --- help-functions | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/help-functions b/help-functions index 4c8537a..1c32354 100755 --- a/help-functions +++ b/help-functions @@ -58,7 +58,7 @@ fn-help-all() { fn-help-contents else cat< /dev/null' RETURN INT TERM EXIT pushd "$SUBCOMMAND_ROOT" > /dev/null 2>&1 for cmd in *; do fn-help-contents-subcommand "$cmd" || true @@ -78,8 +74,10 @@ fn-help-contents() { fn-help-contents-subcommand() { declare SUBCOMMAND="$1" FULL_OUTPUT="$2" + local TMPDIR=$(mktemp -d) local UNCLEAN_FILE="${TMPDIR}cmd-unclean" CLEAN_FILE="${TMPDIR}cmd-clean" local BOLD CMD_OUTPUT CYAN EXAMPLE LIGHT_GRAY NORMAL + trap 'rm -rf "$TMPDIR" > /dev/null' RETURN INT TERM EXIT rm -rf "$UNCLEAN_FILE" "$CLEAN_FILE" cat "$SUBCOMMAND_ROOT/$SUBCOMMAND" > "$UNCLEAN_FILE"