Browse Source

Update pod script's export command

Samuel W. Flint 6 months ago
parent
commit
21f347e19f
1 changed files with 10 additions and 4 deletions
  1. 10 4
      pod

+ 10 - 4
pod

@@ -25,7 +25,7 @@ stop                     : stop current episode, saving current location
 listened [ FILE* ]       : mark current episode as listened or if FILES mark them
 update-feeds             : update feeds
 wanted                   : list wanted episodes
-export [ BRNCH ] [ TGT ] : export unlistened podcasts to device
+export                   : export unlistened podcasts to devices
 EOF
 }
 
@@ -184,9 +184,15 @@ case "$CMD" in
         exit
         ;;
     export)
-        BRANCH=${1:-${POD_EXPORT_BRANCH}}
-        TARGET=${2:-${POD_EXPORT_TARGET}}
-        git_annex_wrap export "${BRANCH}" -t "${TARGET}"
+        grep -v '^# ' ${POD_BASE_DIR}/${POD_SUB_DIR}/export-devices.csv | \
+        while read -r LINE; do
+            REMOTE=$(echo "${LINE}" | cut -f 1)
+            DIRECTORY=$(echo "${LINE}" | cut -f 2)
+            BRANCH=$(echo "${LINE}" | cut -f 3)
+            if [ -d "${DIRECTORY}" ] ; then
+                git_annex_wrap export "${BRANCH}" --to "${REMOTE}"
+            fi
+        done
         exit
         ;;
     *)