mirror of
https://gitee.com/spark-store-project/spark-wine
synced 2025-12-18 21:11:39 +08:00
修复:支持带空格的应用
修复:启动失败
This commit is contained in:
@@ -2,10 +2,9 @@
|
||||
|
||||
SHELL_DIR=$(dirname $(realpath $0))
|
||||
|
||||
# 函数:获取所有应用列表
|
||||
# 函数:获取所有应用列表
|
||||
apps_list=()
|
||||
get_apps_list() {
|
||||
local apps_list=()
|
||||
|
||||
local app_dirs=($(find /opt/apps -mindepth 1 -maxdepth 1 -type d -exec test -f {}/files/run.sh \; -print))
|
||||
|
||||
if [ ${#app_dirs[@]} -eq 0 ]; then
|
||||
@@ -28,17 +27,16 @@ get_apps_list() {
|
||||
version="无法读取"
|
||||
fi
|
||||
# START_SHELL_PATH=XXX/spark_run_v4.sh
|
||||
if grep START_SHELL_PATH= "$run_script" | grep spark_run_v4.sh; then
|
||||
if grep spark_run_v4.sh "$run_script" >/dev/null 2>&1 ; then
|
||||
use_spark="是"
|
||||
fi
|
||||
fi
|
||||
|
||||
local app_name=$(get_app_name "$package_name")
|
||||
|
||||
apps_list+=("$app_name" "$package_name" "$bottle_name" "$version" "$use_spark")
|
||||
apps_list+=("$app_name" "$package_name" "$bottle_name" "$version" "$use_spark")
|
||||
done
|
||||
|
||||
echo "${apps_list[@]}"
|
||||
|
||||
}
|
||||
|
||||
# 函数:获取应用名称
|
||||
@@ -58,14 +56,18 @@ get_app_name() {
|
||||
|
||||
# 函数:选择应用
|
||||
select_app() {
|
||||
local apps_list=($(get_apps_list))
|
||||
local app=$(zenity --print-column=2 --width=800 --height=600 --list --title="选择应用" --text="选择要执行的应用" --column="应用名" --column="包名" --column="容器名" --column="版本号" --column="是否使用星火wine助手" "${apps_list[@]}")
|
||||
get_apps_list
|
||||
for (( i = 0; i < ${#apps_list[@]}; i++ )); do
|
||||
echo ${apps_list[$i]}
|
||||
done
|
||||
|
||||
local app=$(zenity --print-column=2 --width=800 --height=600 --list --title="选择应用" --text="选择要执行的应用" --column="应用名" --column="包名" --column="容器名" --column="版本号" --column="是否使用星火wine助手" "${apps_list[@]}")
|
||||
|
||||
if [ -n "$app" ]; then
|
||||
local app_dir="/opt/apps/$app"
|
||||
local run_script="$app_dir/files/run.sh"
|
||||
local use_spark="否"
|
||||
if if grep START_SHELL_PATH= "$run_script" | grep spark_run_v4.sh; then
|
||||
if grep spark_run_v4.sh "$run_script" >/dev/null 2>&1 ; then
|
||||
use_spark="是"
|
||||
fi
|
||||
if [ "$use_spark" == "是" ]; then
|
||||
@@ -74,6 +76,8 @@ select_app() {
|
||||
select_non_spark_action "$app" "$(get_app_name $app)"
|
||||
fi
|
||||
fi
|
||||
### 还原分隔符
|
||||
IFS="$IFS_OLD"
|
||||
}
|
||||
|
||||
select_non_spark_action(){
|
||||
|
||||
Reference in New Issue
Block a user