Determine type: Redirect stderr for ls

This commit is contained in:
Jeremy Gardais 2019-10-26 18:16:12 +02:00
parent 03d9b6a251
commit 218d7a6523
1 changed files with 1 additions and 2 deletions

View File

@ -99,7 +99,7 @@ fi
IFS="%"
for game_path in ${games_list}; do
local_game_path="${HOME}/${game_path}"
local_game_path_type="$(ls -ld "${local_game_path}" | sed 's/\(^.\).*/\1/')"
local_game_path_type="$(ls -ld -- "${local_game_path}" 2> /dev/null | sed 's/\(^.\).*/\1/')"
game_name="$(basename "${game_path}")"
game_dir="$(dirname "${game_path}")"
@ -125,7 +125,6 @@ for game_path in ${games_list}; do
symlink_game_dir "${game_name}" "${game_dir}"
### If the symlink failed
if [ "${?}" != 0 ]; then
echo $?
printf '\e[1;35m%-6s\e[m\n' "Data of ${game_path} (Homedir) ${local_game_path} are not managed. Type: ${local_game_path_type}. Abort"
exit 3
fi