]> git.nbdom.net Git - nb.git/commitdiff
etc/profile.d/functions
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 19 Feb 2019 01:39:15 +0000 (01:39 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 19 Feb 2019 01:39:15 +0000 (01:39 +0000)
etc/profile.d/functions

index cb7de0b55567e1bebc2d7b24ae826629f4a054ac..5b6b2216a70e37c4e1b574e3fdf02f7623fff573 100755 (executable)
@@ -3,6 +3,8 @@
 # FUNCTIONS - CORE
 #
 #################################################################################
+type -P which > /dev/null || which() { type -P "$1" 2>&1; }
+
 nb_repos() {
        [ -z "$FUNCNAME" ] && local FUNCNAME='nb_repos' # for busybox
        (
@@ -692,15 +694,6 @@ password_create() {
        echo
 }
 
-# Missing sometimes by default
-if ! type which >/dev/null 2>&1; then
-
-which() {
-       type "$1" 2>&1
-}
-
-fi
-
 #unset _which_cache
 _which_cache=""
 which_cache() {