make par command idempotent if possible

This commit is contained in:
gutmet 2020-11-03 12:35:38 +01:00
parent e08e1da514
commit 7650685b08

View File

@ -13,8 +13,12 @@ playlistInfo="$playlistTitle"
output="$(mkdir "$playlistTitle")"
status=$?
if [ $status -ne 0 ]; then
output="$(cd "$playlistTitle")"
status=$?
if [ $status -ne 0 ]; then
playlistTitle=`echo "$playlistJSON" | jq -r '.id'`
mkdir "$playlistTitle"
fi
fi
cd "$playlistTitle"