Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,18 @@ download_and_install() {
}

verify_install() {
if command -v "$BINARY_NAME" > /dev/null 2>&1; then
local installed_path
local installed_path=""
if [ -x "${INSTALL_DIR}/${BINARY_NAME}" ]; then
installed_path="${INSTALL_DIR}/${BINARY_NAME}"
elif command -v "$BINARY_NAME" > /dev/null 2>&1; then
installed_path="$(command -v "$BINARY_NAME")"
fi

if [ -n "$installed_path" ]; then
ok "${BINARY_NAME} 已安装到 ${installed_path}"

local ver_output
ver_output="$("$BINARY_NAME" --version 2>/dev/null || echo '(无法获取版本)')"
ver_output="$("$installed_path" --version 2>/dev/null || echo '(无法获取版本)')"
info "版本: ${ver_output}"
else
warn "${BINARY_NAME} 已安装到 ${INSTALL_DIR}/${BINARY_NAME}"
Expand Down