X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=path_add-function;fp=path-add-function;h=cc613672b9790c7049eefbac6f837bbfe521b8b0;hb=899add9bfd819cefb9d10124aaa92247d3dc7bdf;hp=ec41e06acb8f21ac4f05a5297765df6bcdc7d7dc;hpb=009623e3f113075ab130ba6fb1fb57c64af04b5e;p=distro-setup diff --git a/path-add-function b/path_add-function similarity index 86% rename from path-add-function rename to path_add-function index ec41e06..cc61367 100644 --- a/path-add-function +++ b/path_add-function @@ -2,10 +2,11 @@ # no bashisms so it can be used in debian profile run by dash # --start adds to start of path, which will give it highest priority # --ifexists will add to path only if the directory exists -path-add() { +path_add() { local found x y z - local ifexists=false - local start=false + local ifexists start + ifexists=false + start=false while [ "$1" = --* ]; do if [ "$1" = --start ]; then start=true @@ -22,7 +23,7 @@ path-add() { done unset IFS if ! $found; then - if [ $ifexists = false ] || [ -d $x ]; then + if ! $ifexists || [ -d $x ]; then if $start; then PATH="$x:$PATH" else