Skip to content

Commit aae4a99

Browse files
committed
feat(star): add bin directory to PATH when sourcing star.bash
1 parent a3771e5 commit aae4a99

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

star_2_0_0.bash

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@
55
export _STAR_HOME="${_STAR_HOME:-$HOME/.star}"
66
export _STAR_STARS_DIR="stars"
77

8+
if [ -n "${BASH_SOURCE:-}" ]; then
9+
script_path="${BASH_SOURCE[0]}"
10+
elif [ -n "${ZSH_VERSION:-}" ]; then
11+
script_path="${(%):-%N}"
12+
fi
13+
14+
script_dir="$( cd -- "$( dirname -- "$script_path" )" && pwd )"
15+
16+
if [[ $PATH != *$script_dir* ]]; then
17+
PATH="$script_dir/bin:$PATH"
18+
export PATH
19+
fi
20+
unset script_path
21+
unset script_dir
22+
823
if [[ ! -d "$_STAR_HOME" ]]; then
924
mkdir -p "$_STAR_HOME"
1025
fi

0 commit comments

Comments
 (0)