feat: 新增获取系统包管理器的函数

This commit is contained in:
Olia Lisa 2025-02-08 17:49:52 +08:00
parent c68d16b360
commit 6951d0d46f

View File

@ -0,0 +1,15 @@
#!/bin/bash
# 获取系统包管理器
get_package_manager(){
if command -v apt-get &> /dev/null; then
echo "apt-get"
elif command -v yum &> /dev/null; then
echo "yum"
else
echo "未知的系统包管理器"
return 1 # 返回错误状态码
fi
}