Use type -P instead of -p
This commit is contained in:
parent
f5c6abb026
commit
9e3a711a86
8
tldr
8
tldr
|
@ -184,7 +184,7 @@ Recent(){ find "$1" -mtime -"${TLDR_EXPIRY// /}" >/dev/null 2>&1;}
|
||||||
# Initialize globals, check the environment; Uses: config cachedir version
|
# Initialize globals, check the environment; Uses: config cachedir version
|
||||||
# Sets: stdout os version dl
|
# Sets: stdout os version dl
|
||||||
Config(){
|
Config(){
|
||||||
type -p less >/dev/null || TLDR_LESS=0
|
type -P less >/dev/null || TLDR_LESS=0
|
||||||
|
|
||||||
os=common stdout='' Q='"' N=$'\n'
|
os=common stdout='' Q='"' N=$'\n'
|
||||||
case "$(uname -s)" in
|
case "$(uname -s)" in
|
||||||
|
@ -202,8 +202,8 @@ Config(){
|
||||||
version="tldr-bash-client version $version$XB ${URL}http://gitlab.com/pepa65/tldr-bash-client$XURL"
|
version="tldr-bash-client version $version$XB ${URL}http://gitlab.com/pepa65/tldr-bash-client$XURL"
|
||||||
|
|
||||||
# Select download method
|
# Select download method
|
||||||
dl="$(type -p curl) -sLfo" || {
|
dl="$(type -P curl) -sLfo" || {
|
||||||
dl="$(type -p wget) --max-redirect=20 -qNO" || {
|
dl="$(type -P wget) --max-redirect=20 -qNO" || {
|
||||||
Err "tldr requires ${I}curl$XI or ${I}wget$XI installed in your path"
|
Err "tldr requires ${I}curl$XI or ${I}wget$XI installed in your path"
|
||||||
exit 3
|
exit 3
|
||||||
}
|
}
|
||||||
|
@ -371,7 +371,7 @@ Find_regex(){
|
||||||
Cache_fill(){
|
Cache_fill(){
|
||||||
updated=0
|
updated=0
|
||||||
local tmp unzip
|
local tmp unzip
|
||||||
unzip="$(type -p unzip) -q" || {
|
unzip="$(type -P unzip) -q" || {
|
||||||
Err "tldr requires ${I}unzip$XI to fill the cache"
|
Err "tldr requires ${I}unzip$XI to fill the cache"
|
||||||
exit 7
|
exit 7
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue