diff --git a/bashrc b/bashrc index 3e7da49..96eaee0 100644 --- a/bashrc +++ b/bashrc @@ -15,5 +15,4 @@ for rc_file in $WORKSPACE/rc/*.sh; do done append_path "$LWS/bin" -PATH="$(uniq_path)" - +set_uniq_path diff --git a/rc/01-functions.sh b/rc/01-functions.sh index 86fff51..db5f961 100644 --- a/rc/01-functions.sh +++ b/rc/01-functions.sh @@ -35,7 +35,16 @@ function uniq_path() { echo "$PATH" | tr ":" "\n" | awk '!seen[$0]++' | tr "\n" ":" | sed -r 's/:+/:/g' | sed -r 's/^:|:$//g' } +function set_uniq_path() { + PATH="$(uniq_path)" +} + +function is_alias() { + alias "$1" > /dev/null 2>&1 +} + function can_run() { local application="$1" command -v "$application" > /dev/null } +