Skip to content

Commit

Permalink
Fix PATH component setting
Browse files Browse the repository at this point in the history
  • Loading branch information
kigster committed Jul 9, 2021
1 parent f36a80b commit 31115f0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions init.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#!/usr/bin/env bash
# vim: ft=bash

for path in /usr/local/bin /usr/bin /bin /sbin /usr/sbin /opt/local/bin; do
[[ -d "${path}" ]] && echo "${PATH}" | grep -q "${path}" || export PATH="${PATH}"
for _path in /usr/local/bin /usr/bin /bin /sbin /usr/sbin /opt/local/bin; do
((DEBUG)) && echo "PATH=[${PATH}], checking for PATH component [${_path}]"
[[ -d "${_path}" ]] && {
(echo ":${PATH}:" | grep -q ":${_path}:") || {
export PATH="${PATH}:${_path}"
}
}
done

set +e
Expand Down

0 comments on commit 31115f0

Please sign in to comment.