Skip to content

Commit 7a91fbd

Browse files
author
emmett1
committed
replace type with command
1 parent 00e55a2 commit 7a91fbd

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

pkgbuild

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ prepare_src() {
158158
if [ "$FILENAME" != "$FILE" ] && [ "$nxt" != 1 ]; then
159159
case $FILENAME in
160160
*.tar|*.tar.gz|*.tar.Z|*.tgz|*.tar.bz2|*.tbz2|*.tar.xz|*.txz|*.tar.lzma|*.zip|*.rpm)
161-
if [ $(type -p bsdtar) ]; then
161+
if [ $(command -v bsdtar) ]; then
162162
COMMAND="bsdtar -p -o -C $SRC -xf $FILENAME"
163163
else
164164
COMMAND="tar -p -o -C $SRC -xf $FILENAME"
@@ -415,7 +415,7 @@ check_buildscript() {
415415
elif [ -z "$release" ]; then
416416
msgerr "'release' is empty!"
417417
exit 1
418-
elif [ "$(type -t build)" != "function" ]; then
418+
elif [ ! "$(command -v build)" ]; then
419419
msgerr "'build' function not exist!"
420420
exit 1
421421
elif echo "$version" | grep -q '-'; then

pkgquery

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ fi
350350

351351
shift
352352

353-
if [ $(type -t pkg_$opts) ]; then
353+
if [ $(command -v pkg_$opts) ]; then
354354
pkg_$opts "$@"
355355
else
356356
print_runhelp_msg

updateconf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
EDITOR=${EDITOR:-vi}
2222

23-
type -p $EDITOR >/dev/null || {
23+
command -v $EDITOR >/dev/null || {
2424
echo "Editor '$EDITOR' not exist. Append 'EDITOR=<your editor>' to ${0##*/}."
2525
exit 2
2626
}

0 commit comments

Comments
 (0)