From 84d51e16441330282bd06a028507561d7243303f Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Mon, 12 Sep 2016 19:31:45 -0400 Subject: avoid duplicating expensive call to "stack path" --- dot/bashrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'dot/bashrc') diff --git a/dot/bashrc b/dot/bashrc index 9b257b6..c289c5f 100644 --- a/dot/bashrc +++ b/dot/bashrc @@ -40,6 +40,7 @@ memoize_retval() add_stack_binpath() { + [ "$STACK_PATH_HAS_BEEN_SET" ] && return local result="$( stack path 2>&1 | while read k v do case "$k" in @@ -51,7 +52,7 @@ memoize_retval() esac done )" - [ "$result" ] && eval "$result" + [ "$result" ] && eval "$result" && export STACK_PATH_HAS_BEEN_SET=y } ### bash settings, general environment ### -- cgit v1.2.3