Browse Source

feat: auto add to PATH to gimme script when including/sourcing it

Kyle Davis 6 years ago
parent
commit
5b3511c005
1 changed files with 5 additions and 0 deletions
  1. 5 0
      gimme

+ 5 - 0
gimme

@@ -76,6 +76,11 @@ if [[ "$0" =~ [-]?bash ]]; then # sourced or piped
 
 	if [[ "${BASH_SOURCE[@]}" ]]; then # sourced
 
+		# if 'gimme' is not Add gimme to the PATH if not already found
+		if ! [[ "$PATH" == *"$GIMME_DIR"* ]]; then
+			export PATH="$PATH:$GIMME_DIR"
+		fi
+
 		# setup autocompletion for gimmes
 		_gimme_completely() {
 			if [[ "$2" = -* ]]; then