Sfoglia il codice sorgente

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

Kyle Davis 7 anni fa
parent
commit
5b3511c005
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  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