mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-09-08 12:22:21 +08:00
修复每次都提示首次安装ACE的问题
Signed-off-by: shenmo <jifengshenmo@outlook.com>
This commit is contained in:
parent
fb9385fccd
commit
37ef14e975
36
tool/ssaudit
36
tool/ssaudit
@ -200,19 +200,41 @@ function ensure_aptss_exist() {
|
|||||||
}
|
}
|
||||||
export -f ensure_aptss_exist
|
export -f ensure_aptss_exist
|
||||||
|
|
||||||
|
# 确保ACE环境存在
|
||||||
# 确保ACE环境存在
|
# 确保ACE环境存在
|
||||||
function ensure_ace_env() {
|
function ensure_ace_env() {
|
||||||
local ace_env_pkg="${1}"
|
local ace_env_pkg="${1}"
|
||||||
|
local ace_cmd=""
|
||||||
|
|
||||||
echo "ACE环境$ace_env_pkg正在尝试安装..."
|
# 根据配置找到对应命令
|
||||||
zenity --info --text="首次使用$ace_env_pkg环境,重启或注销桌面后才能在启动器中展示,不影响应用启动。安装将在后台继续。" --title="ACE环境安装" &
|
for ace_entry in "${ACE_ENVIRONMENTS[@]}"; do
|
||||||
if ! aptss install -y "$ace_env_pkg"; then
|
if [ "${ace_entry#*:}" = "$ace_env_pkg" ]; then
|
||||||
echo "安装$ace_env_pkg失败"
|
ace_cmd="${ace_entry%%:*}"
|
||||||
return 1
|
break
|
||||||
fi
|
fi
|
||||||
return 0
|
done
|
||||||
|
|
||||||
|
# 如果命令存在,则说明环境已可用
|
||||||
|
if command -v "$ace_cmd" &>/dev/null; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "ACE环境 $ace_env_pkg 未安装,正在尝试安装..."
|
||||||
|
zenity --info --text="首次使用 $ace_env_pkg 环境,重启或注销桌面后才能在启动器中展示,不影响应用启动。安装将在后台继续。" --title="ACE环境安装" &
|
||||||
|
if ! aptss install -y "$ace_env_pkg"; then
|
||||||
|
echo "安装 $ace_env_pkg 失败"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 再次确认命令
|
||||||
|
if command -v "$ace_cmd" &>/dev/null; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
echo "ACE环境 $ace_env_pkg 安装后未检测到命令 $ace_cmd"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
export user=$(who | awk '{print $1}' | head -n 1)
|
export user=$(who | awk '{print $1}' | head -n 1)
|
||||||
# 在桌面创建快捷方式
|
# 在桌面创建快捷方式
|
||||||
function create_desktop_file() {
|
function create_desktop_file() {
|
||||||
|
@ -200,18 +200,41 @@ function ensure_aptss_exist() {
|
|||||||
}
|
}
|
||||||
export -f ensure_aptss_exist
|
export -f ensure_aptss_exist
|
||||||
|
|
||||||
|
# 确保ACE环境存在
|
||||||
# 确保ACE环境存在
|
# 确保ACE环境存在
|
||||||
function ensure_ace_env() {
|
function ensure_ace_env() {
|
||||||
local ace_env_pkg="${1}"
|
local ace_env_pkg="${1}"
|
||||||
|
local ace_cmd=""
|
||||||
echo "ACE环境$ace_env_pkg正在尝试安装..."
|
|
||||||
zenity --info --text="首次使用$ace_env_pkg环境,重启或注销桌面后才能在启动器中展示,不影响应用启动。安装将在后台继续。" --title="ACE环境安装" &
|
# 根据配置找到对应命令
|
||||||
if ! aptss install -y "$ace_env_pkg"; then
|
for ace_entry in "${ACE_ENVIRONMENTS[@]}"; do
|
||||||
echo "安装$ace_env_pkg失败"
|
if [ "${ace_entry#*:}" = "$ace_env_pkg" ]; then
|
||||||
return 1
|
ace_cmd="${ace_entry%%:*}"
|
||||||
|
break
|
||||||
fi
|
fi
|
||||||
return 0
|
done
|
||||||
|
|
||||||
|
# 如果命令存在,则说明环境已可用
|
||||||
|
if command -v "$ace_cmd" &>/dev/null; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "ACE环境 $ace_env_pkg 未安装,正在尝试安装..."
|
||||||
|
zenity --info --text="首次使用 $ace_env_pkg 环境,重启或注销桌面后才能在启动器中展示,不影响应用启动。安装将在后台继续。" --title="ACE环境安装" &
|
||||||
|
if ! aptss install -y "$ace_env_pkg"; then
|
||||||
|
echo "安装 $ace_env_pkg 失败"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 再次确认命令
|
||||||
|
if command -v "$ace_cmd" &>/dev/null; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
echo "ACE环境 $ace_env_pkg 安装后未检测到命令 $ace_cmd"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
export user=$(who | awk '{print $1}' | head -n 1)
|
export user=$(who | awk '{print $1}' | head -n 1)
|
||||||
# 在桌面创建快捷方式
|
# 在桌面创建快捷方式
|
||||||
function create_desktop_file() {
|
function create_desktop_file() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user