]> gitweb.fluxo.info Git - scripts.git/commitdiff
Adding playlist-drop
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 14 Mar 2013 23:03:44 +0000 (20:03 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 14 Mar 2013 23:03:44 +0000 (20:03 -0300)
playlist-drop [new symlink]
playlist-get

diff --git a/playlist-drop b/playlist-drop
new file mode 120000 (symlink)
index 0000000..a766a62
--- /dev/null
@@ -0,0 +1 @@
+playlist-get
\ No newline at end of file
index 89909332719fea8a709db5ff1c5e4ce4695ed4ec..7a688d97a2ecb7a6ffe86435806dc3a17bf344f3 100755 (executable)
@@ -25,11 +25,17 @@ elif [ ! -f "$PLAYLISTS/$PLAYLIST.m3u" ]; then
   exit 1
 fi
 
+if [ "$BASENAME" == "playlist-drop" ]; then
+  command="drop"
+else
+  command="get"
+fi
+
 echo "Getting files from $PLAYLISTS/$PLAYLIST.m3u..."
 
 cat $PLAYLISTS/$PLAYLIST.m3u | while read file; do
   dir="$(dirname "$file")"
   base="$(basename "$file")"
-  ( cd "$MEDIA/$dir" && git annex get "$base" )
+  ( cd "$MEDIA/$dir" && git annex $command "$base" )
 done