Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PortWINE
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mikhail Tergoev
PortWINE
Commits
45808947
Commit
45808947
authored
Oct 31, 2024
by
Mikhail Tergoev
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'cli-func1' of github.com:Htylol/PortWINE into Htylol-cli-func1
parents
7036f06b
0e0ec302
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
6 deletions
+31
-6
functions_helper
data_from_portwine/scripts/functions_helper
+15
-0
start.sh
data_from_portwine/scripts/start.sh
+16
-6
No files found.
data_from_portwine/scripts/functions_helper
View file @
45808947
...
...
@@ -63,6 +63,21 @@ export -f make_abbreviation
check_variables
()
{
[[
-z
${
!1
}
]]
&&
export
$1
=
"
$2
"
;
}
# Эксортирует несколько переменных за один раз (одной командой)
# и создаёт список этих переменных в $keys_all
# К примеру set_several_variables PW_MANGOHUD=1 PW_VKBASALT=0
set_several_variables
()
{
local
key value
unset
keys_all
while
((
$#
>
0
))
;
do
key
=
${
1
//=*/
}
value
=
${
1
//*=/
}
keys_all+
=
"
$key
"
export
"
$key
"
=
"
$value
"
shift
done
}
add_to_var
()
{
if
!
echo
${
!1
}
|
grep
"
$2
"
&>/dev/null
then
export
$1
=
"
${
!1
}
$2
"
...
...
data_from_portwine/scripts/start.sh
View file @
45808947
...
...
@@ -56,19 +56,19 @@ if [[ "$1" == *.[Pp][Pp][Aa][Cc][Kk] ]] ; then
elif
[[
-f
"
$1
"
]]
;
then
portwine_exe
=
"
$(
real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wine_exe
=
"
$1
"
MISSING_DESKTOP_FILE
=
"1"
...
...
@@ -365,7 +365,7 @@ fi
### CLI ###
case
"
$
{
1
}
"
in
case
"
$
1
"
in
'--help'
)
files_from_autoinstall
=
$(
ls
"
${
PORT_SCRIPTS_PATH
}
/pw_autoinstall"
)
echo
-e
"
...
...
@@ -418,6 +418,16 @@ use: [--repair] [--reinstall] [--autoinstall]
'--update'
)
gui_pw_update
;;
'--launch'
)
portwine_launch
stop_portwine
;;
'--edit-db'
)
# --edit-db /полный/путь/до/файла.exe PW_MANGOHUD=1 PW_VKBASALT=0 (и т.д) для примера
set_several_variables
${
@
:3
}
edit_db_from_gui
$keys_all
exit
0
;;
esac
### GUI ###
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment