kreyren |
Sunday 30 December 2018 at 18:09
|
kreyren
|
http://wiki.playonlinux.com/index.php/Scripting_-_Chapter_1:_Getting_to_know_Bash#Requirements_of_every_script required update.
Is this sufficient?
<pre class="code playonlinux">
#!/usr/bin/env playonlinux-bash
if [[ $PLAYONLINUX=="" ]]; then
exit 0
echo "TODO: $PLAYONLINUX variable is empty" # TODO: Why is var required not empty?
else
source "$PLAYONLINUX/lib/sources"
fi
POL_SetupWindow_Init # Initiates Setup Window
POL_SetupWindow_Close # Closes Setup Window
exit
</pre>
Editado por: kreyren
|
kreyren |
Sunday 30 December 2018 at 18:11
|
kreyren
|
Requires more info to line 3:
`echo "TODO: $PLAYONLINUX variable is empty" # TODO: Why is var required not empty?`
|
Quentin PÂRIS |
Sunday 30 December 2018 at 21:12
|
Quentin PÂRIS
|
In fact we used to encourage the usage of a long code, but at the end it does not happen often. So to make the code more readable, we prefer being more concise
|
kreyren |
Sunday 30 December 2018 at 22:57
|
kreyren
|
Noted, can you elaborate on PLAYONLINUX variable? Meaning what does it mean?
My abstract is to rather make `if [[ $PLAYONLINUX = <Game_name> ]]; then` ....
|
Quentin PÂRIS |
Monday 31 December 2018 at 0:18
|
Quentin PÂRIS
|
$PLAYONLINUX is just a variable that contains the path of the lib/ folder in PlayOnLinux installation. It is required to have access to POL_SetupWindow_* commands, and the script is just checking that this variable exist, so we are sure that we are inside a PlayOnLinux context
|
kreyren |
Monday 31 December 2018 at 18:20
|
kreyren
|
So is using:
`PLAYONLINUX="/usr/share/playonlinux/lib" ` sane or is there any scenario in which it would be empty?
|