Load matchit plugin where available.
[profile.git] / .profile.d / BECOME.bashrc
1 # Find a path, preferring the target user's version.
2 function find_target_profile() {
3   local path="$1"; shift
4
5   for dir in $HOME $PROFILE_HOME; do
6     if [ -e "$dir/$path" ]; then
7       echo "$dir/$path"
8       break
9     fi
10   done
11
12   unset dir
13 }
14
15 # Find a path, preferring the source user's version.
16 function find_source_profile() {
17   local path="$1"; shift
18
19   for dir in $PROFILE_HOME $HOME; do
20     if [ -e "$dir/$path" ]; then
21       echo "$dir/$path"
22       break
23     fi
24   done
25
26   unset dir
27 }