fix: 修复包管理器检测,info 输出到 stderr
This commit is contained in:
4
setup.sh
4
setup.sh
@@ -71,14 +71,14 @@ command_exists() {
|
|||||||
get_package_manager() {
|
get_package_manager() {
|
||||||
if command_exists node; then
|
if command_exists node; then
|
||||||
local node_version=$(node --version 2>/dev/null | sed 's/v//')
|
local node_version=$(node --version 2>/dev/null | sed 's/v//')
|
||||||
info "检测到 Node.js v$node_version"
|
info "检测到 Node.js v$node_version" >&2
|
||||||
echo "npm"
|
echo "npm"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command_exists bun; then
|
if command_exists bun; then
|
||||||
local bun_version=$(bun --version 2>/dev/null)
|
local bun_version=$(bun --version 2>/dev/null)
|
||||||
info "检测到 Bun v$bun_version"
|
info "检测到 Bun v$bun_version" >&2
|
||||||
echo "bun"
|
echo "bun"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user