Create file only if does not exists + fixed syntax

This commit is contained in:
Lx32 2024-09-24 21:53:52 +02:00
parent ec1f9a0305
commit 4c2e555812
2 changed files with 13 additions and 7 deletions

View file

@ -76,6 +76,9 @@ add_to_steam() {
log d "Sanitized Name: $sanitized_name"
local launcher="$steamsync_folder/${sanitized_name}.sh"
if [ ! -e $launcher ]; then
log d "Creating desktop file: $launcher"
# if [[ -v command_list_default[$system] ]]; then
@ -103,16 +106,19 @@ add_to_steam() {
# EOF
cat <<EOF > "$launcher"
#!/bin/bash
if [ test "$(whereis flatpak)" = "flatpak:" ]; then
if [ test "\$(whereis flatpak)" = "flatpak:" ]; then
flatpak-spawn --host $command
else
$command
fi
EOF
else
log d "$launcher desktop file already exists"
fi
done
fi
done
steam-rom-manager add
#steam-rom-manager add
log i "Steam Sync: completed"
}