diff --git a/games/save.game.steam b/games/save.game.steam index 072700d..5b73c85 100755 --- a/games/save.game.steam +++ b/games/save.game.steam @@ -257,6 +257,12 @@ for game_pattern in ${steam_compatdata_games_pattern}; do ### Follow symbolic links but avoid links to dosdevices and keep only one result temp_local_save_path="$(find -L "${HOME}/${steam_compatdata}/${game_id}" -ipath "*dosdevices*" -prune -o -iname "${save_pattern}" | grep -v "dosdevices" | head -n 1)" + ### Verify if the previous command successfully return an existing path + if [ ! -e "${temp_local_save_path}" ]; then + printf '\e[1;35m%-6s\e[m\n' "Data of ${game_id} (compatdata) − Can't find the path to ${save_pattern} pattern. Result of find : ${temp_local_save_path} . Abort." + exit 3 + fi + local_save_path="$(dirname "${temp_local_save_path}")" local_save_path_type="$(ls -ld "${local_save_path}" | sed 's/\(^.\).*/\1/')" ## Path independent from local or remote base directory @@ -281,6 +287,7 @@ for game_pattern in ${steam_compatdata_games_pattern}; do ;; ## Data is still a directory, try to move it "directory"|"d") + [ "${debug}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG : Data of ${game_id} (compatdata) − Try to move ${local_save_path} to remote share." move_steam_game_dir "$(basename "${steam_dir}")" "$(dirname "${steam_dir}")" ;; ## Data doesn't exist