From d501d66de9155d7c74c8c96ee7f6e21dcd2be2fa Mon Sep 17 00:00:00 2001 From: bin456789 Date: Thu, 21 Sep 2023 00:12:48 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E7=94=A8=20which=20=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reinstall.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reinstall.sh b/reinstall.sh index cf9df44..ce6cabe 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -576,10 +576,11 @@ install_pkg() { is_in_windows && return for cmd in "$@"; do - if ! command -v $cmd || + # 用 which 而不是 command -v,因为 command -v 把脚本中的function也算在内 + if ! which $cmd >/dev/null || # gentoo 默认编译的 unsquashfs 不支持 xz { [ "$cmd" = unsquashfs ] && - command -v emerge && + which emerge >/dev/null && ! unsquashfs |& grep -w xz && echo "unsquashfs not supported xz. need rebuild."; }; then