Skip to content

Commit dbad6ba

Browse files
committed
custom path
1 parent a54692d commit dbad6ba

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ Quick Tasks are tasks defined in a directory and will work only in that director
131131

132132
$ soda my-task
133133

134+
## Custom PATH
135+
136+
Any directory in the form `bin/$NAMESPACE` in both `$SODA_HOME` or `$SODA_USER_HOME` will be included in the `$PATH` variable.
137+
134138
## Bash Completion
135139

136140
SODA supports bash completion by importing all namespaces and searching for defined parameters

scripts/core.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,12 @@ import() {
168168
load_scripts "$SODA_HOME/scripts/$1"
169169
if ! [[ "$SODA_HOME" == "$SODA_USER_HOME" ]]; then
170170
load_scripts "$SODA_USER_HOME/scripts/$1"
171+
load_binaries "$SODA_USER_HOME/bin/$1"
171172
fi
173+
load_binaries "$SODA_HOME/bin/$1"
172174
if [[ -n $OLD_NAMESPACE ]]; then
173175
NAMESPACE="$OLD_NAMESPACE"
174176
fi
175-
176177
return 0
177178
else
178179
return 1
@@ -208,6 +209,15 @@ load_scripts() {
208209
fi
209210
}
210211

212+
#
213+
# Put the directory in PATH
214+
#
215+
load_binaries() {
216+
if [[ -d "$1" ]]; then
217+
export PATH="$PATH:$1"
218+
fi
219+
}
220+
211221
#
212222
# Loads all config files inside a directory
213223
#

0 commit comments

Comments
 (0)