begin-theadventure / dxvk-caches

/OUTDATED for DXVK 2.0+/DXVK state caches to reduce stuttering!
https://sam.nl.tab.digital/s/oZRKz5So2B8gbzY
zlib License
82 stars 7 forks source link

get-dxvk-caches.sh does not work with files that contains spaces #5

Closed ghost closed 2 years ago

ghost commented 2 years ago

The problem

The script fails on files that contains spaces

cp $(find "/var/data/steam/steamapps/shadercache" -iname "*dxvk-cache") dxvk
cp: cannot stat '/var/data/steam/steamapps/shadercache/632360/DXVK_state_cache/Risk': No such file or directory
cp: cannot stat 'of': No such file or directory
cp: cannot stat 'Rain': No such file or directory
cp: cannot stat '2.dxvk-cache': No such file or directory

This is because the output of find is actually one long string with line breaks.

The solution

I suggest swapping the commands around. So for every file we find, we copy it. find "directoryhere" -iname "*dxvk-cache" -exec cp "{}" dxvk \;

begin-theadventure commented 2 years ago

Actually, you could've opened a pull request but it's fine :) I will try it out.