diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2024-09-06 16:43:10 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2024-09-06 16:43:10 -0300 |
commit | e5beb1476a7228563b4c182e06b5f6fd793bcf3d (patch) | |
tree | b8a8495e7b85b1f23c564bfb08dd8996b58e4d03 /playlist-orphans | |
parent | b99e56674492cde24483f9415bfd2e66bd0acce7 (diff) | |
download | playlister-e5beb1476a7228563b4c182e06b5f6fd793bcf3d.tar.gz playlister-e5beb1476a7228563b4c182e06b5f6fd793bcf3d.tar.bz2 |
Fix: playlister: support for checking on arbitrary folders
Diffstat (limited to 'playlist-orphans')
-rwxr-xr-x | playlist-orphans | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/playlist-orphans b/playlist-orphans index c66bd93..cb103d2 100755 --- a/playlist-orphans +++ b/playlist-orphans @@ -34,7 +34,7 @@ function playlist_orphan { function playlist_orphans { local cwd="`pwd`" - cd $MEDIA + #cd $MEDIA if [ ! -z "$FILE" ]; then playlist_orphan $FILE @@ -46,24 +46,26 @@ function playlist_orphans { done fi - cd $cwd + #cd $cwd } # Basic syntax check if [ "$ITEM" == "--help" ]; then echo "Usage: $BASENAME [file|folder]" + echo "" + echo "Example: $basename /path/to/some/media/files/" exit 1 fi # Determine items if [ ! -z "$ITEM" ]; then - if [ -d "$MEDIA/$ITEM" ]; then - FOLDER="$MEDIA/$ITEM" - elif [ -e "$MEDIA/$ITEM" ] || [ -L "$MEDIA/$ITEM" ]; then - FILE="$MEDIA/$ITEM" + if [ -d "$ITEM" ]; then + FOLDER="$ITEM" + elif [ -e "$ITEM" ] || [ -L "$ITEM" ]; then + FILE="$ITEM" else - echo "$BASENAME: error: item not found: $MEDIA/$ITEM" + echo "$BASENAME: error: item not found: $ITEM" exit 1 fi else |