Skip to content

Commit

Permalink
fix bug where entire file system contents were moved when launching a…
Browse files Browse the repository at this point in the history
… gog game that did not have a goggame info file
  • Loading branch information
alkazar committed Sep 22, 2024
1 parent b642d2b commit 9425710
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions bin/gog-launcher
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ fi

# Windows
rm -rf tmp
appdir=$(dirname `find . -name "goggame*.info"`)
gogfile=$(find . -name "goggame*.info")

if [ "$appdir" != "." ]; then
mv $appdir/* .
rm -rf $appdir
if [ -n "$gogfile" ]; then
appdir=$(dirname $gogfile)
if [ "$appdir" != "." ]; then
mv $appdir/* .
rm -rf $appdir
fi
fi

exe=$(yq ".[] | select(.id == ${1}) | select(.platform == \"gog\") | .exe" ~/.local/share/chimera/data/gamedb.yaml)
Expand All @@ -22,4 +25,6 @@ if [ -n "$exe" ] && [ "$exe" != "null" ]; then
exit
fi

cat goggame*.info | jq '.playTasks[0].path' | sed 's/"//g'
if [ -n "$gogfile" ]; then
cat goggame*.info | jq '.playTasks[0].path' | sed 's/"//g'
fi

0 comments on commit 9425710

Please sign in to comment.