Commit 92d86fb4 authored by Vladislav's avatar Vladislav

Added --launch and --edit-db for cli

parent ef83c607
...@@ -63,6 +63,18 @@ export -f make_abbreviation ...@@ -63,6 +63,18 @@ export -f make_abbreviation
check_variables () { [[ -z ${!1} ]] && export $1="$2" ;} check_variables () { [[ -z ${!1} ]] && export $1="$2" ;}
cli_edit_db () {
local key value
unset keys_all
while (( $# > 0 )); do
key=$(echo "$1" | cut -d'=' -f1)
value=$(echo "$1" | cut -d'=' -f2)
keys_all+="$key "
export "$key"="$value"
shift
done
}
add_to_var () { add_to_var () {
if ! echo ${!1} | grep "$2" &>/dev/null if ! echo ${!1} | grep "$2" &>/dev/null
then export $1="${!1} $2" then export $1="${!1} $2"
......
...@@ -59,11 +59,11 @@ elif [[ -f "$OLDPWD/$1" ]] \ ...@@ -59,11 +59,11 @@ elif [[ -f "$OLDPWD/$1" ]] \
&& [[ "$1" == *.[Ee][Xx][Ee] || "$1" == *.[Bb][Aa][Tt] || "$1" == *.[Rr][Ee][Gg] || "$1" == *.[Mm][Ss][Ii] ]] && [[ "$1" == *.[Ee][Xx][Ee] || "$1" == *.[Bb][Aa][Tt] || "$1" == *.[Rr][Ee][Gg] || "$1" == *.[Mm][Ss][Ii] ]]
then then
portwine_exe="$(realpath -s "$OLDPWD/$1")" portwine_exe="$(realpath -s "$OLDPWD/$1")"
elif [[ "$1" == "--debug" ]] \ elif [[ "$1" =~ (^--debug$|^--launch$|^--edit-db$) ]] \
&& [[ -f "$2" ]] && [[ -f "$2" ]]
then then
portwine_exe="$(realpath -s "$2")" portwine_exe="$(realpath -s "$2")"
elif [[ "$1" == "--debug" ]] \ elif [[ "$1" =~ (^--debug$|^--launch$|^--edit-db$) ]] \
&& [[ -f "$OLDPWD/$2" ]] \ && [[ -f "$OLDPWD/$2" ]] \
&& [[ "$2" == *.[Ee][Xx][Ee] || "$2" == *.[Bb][Aa][Tt] || "$2" == *.[Rr][Ee][Gg] || "$2" == *.[Mm][Ss][Ii] ]] && [[ "$2" == *.[Ee][Xx][Ee] || "$2" == *.[Bb][Aa][Tt] || "$2" == *.[Rr][Ee][Gg] || "$2" == *.[Mm][Ss][Ii] ]]
then then
...@@ -360,7 +360,7 @@ fi ...@@ -360,7 +360,7 @@ fi
### CLI ### ### CLI ###
case "${1}" in case "$1" in
'--help' ) '--help' )
files_from_autoinstall=$(ls "${PORT_SCRIPTS_PATH}/pw_autoinstall") files_from_autoinstall=$(ls "${PORT_SCRIPTS_PATH}/pw_autoinstall")
echo -e " echo -e "
...@@ -413,6 +413,18 @@ use: [--repair] [--reinstall] [--autoinstall] ...@@ -413,6 +413,18 @@ use: [--repair] [--reinstall] [--autoinstall]
'--update' ) '--update' )
gui_pw_update ;; gui_pw_update ;;
'--launch' )
export START_FROM_STEAM=1
export LD_PRELOAD=
portwine_launch
stop_portwine ;;
'--edit-db' )
# --edit-db /полный/путь/до/файла.exe PW_MANGOHUD=1 PW_VKBASALT=0 (и т.д) для примера
cli_edit_db ${@:3}
edit_db_from_gui $keys_all
exit 0 ;;
esac esac
### GUI ### ### GUI ###
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment