Use symlink function as much as possible

This commit is contained in:
Jeremy Gardais 2019-10-08 19:10:37 +02:00
parent 76e7b10082
commit f8e516c37c
1 changed files with 5 additions and 4 deletions

View File

@ -90,12 +90,13 @@ move_steam_game_dir() {
## If a remote directory doesn't already exists for this game
if [ ! -d "${_remote_game_path}" ]; then
### Move data to remote storage
mv -- "${_local_game_path}" "${_remote_game_path}"
[ "${debug}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "Move Steam game The data of ${_game_id} ${_local_game_path} moved to remote storage."
ln -s -- "${_remote_game_path}" "${_local_game_path}"
[ "${debug}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "Move Steam game Symlink remote to data of ${_game_id} to local storage."
[ "${debug}" -eq "0" ] && printf '\e[1;35m%-6s\e[m\n' "DEBUG: Move Steam game The data of ${_game_id} ${_local_game_path} moved to remote storage."
### Then ask to create a symbolic link to local storage
symlink_steam_game_dir "${_game_id}" "${_steam_dir}"
else
printf '\e[1;35m%-6s\e[m\n' "Move Steam game ${_game_id} already have data on remote storage: ${_remote_game_path}. Abort to avoid to delete data."
printf '\e[1;35m%-6s\e[m\n' "Move Steam game ${_game_id} already have data on remote storage: ${_remote_game_path}. Abort to avoid to override data."
exit 5
fi
}