Commit 47d0f713 authored by Vitaly Lipatov's avatar Vitaly Lipatov

eget: update which workaround

parent 3ccb71d0
...@@ -107,22 +107,22 @@ docmd() ...@@ -107,22 +107,22 @@ docmd()
# copied from epm # copied from epm
# print a path to the command if exists in $PATH # print a path to the command if exists in $PATH
if which which 2>/dev/null >/dev/null ; then if a= which which 2>/dev/null >/dev/null ; then
# the best case if we have which command (other ways needs checking) # the best case if we have which command (other ways needs checking)
# TODO: don't use which at all, it is binary, not builtin shell command # TODO: don't use which at all, it is binary, not builtin shell command
print_command_path() print_command_path()
{ {
which -- "$1" 2>/dev/null a= which -- "$1" 2>/dev/null
} }
elif type -a type 2>/dev/null >/dev/null ; then elif a= type -a type 2>/dev/null >/dev/null ; then
print_command_path() print_command_path()
{ {
type -fpP -- "$1" 2>/dev/null a= type -fpP -- "$1" 2>/dev/null
} }
else else
print_command_path() print_command_path()
{ {
type "$1" 2>/dev/null | sed -e 's|.* /|/|' a= type "$1" 2>/dev/null | sed -e 's|.* /|/|'
} }
fi fi
...@@ -133,7 +133,6 @@ is_command() ...@@ -133,7 +133,6 @@ is_command()
} }
# check man glob # check man glob
filter_glob() filter_glob()
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment