diff options
Diffstat (limited to '')
-rwxr-xr-x | scripts/assert-content.sh | 82 |
1 files changed, 39 insertions, 43 deletions
diff --git a/scripts/assert-content.sh b/scripts/assert-content.sh index ff571c3..6694153 100755 --- a/scripts/assert-content.sh +++ b/scripts/assert-content.sh @@ -125,23 +125,22 @@ assert-frontmatter() { fi done - for audiofmt in ogg; do - OGG="resources/podcasts/$DATE-$SLUG.ogg" - TORRENT="$OGG.torrent" - WEBSEED="https://euandre.org/$OGG" - if [ ! -f "$TORRENT" ]; then - yellow "Missing torrent $TORRENT, generating..." - mktorrent $TRACKERS \ - -f \ - -v \ - -d \ - -c "$(cat _podcasts/$DATE-$SLUG.md)" \ - -n "$TITLE.ogg" \ - -w "$WEBSEED" \ - -o "$TORRENT" \ - "$OGG" - fi - done + OGG="resources/podcasts/$DATE-$SLUG.ogg" + TORRENT="$OGG.torrent" + WEBSEED="https://euandre.org/$OGG" + if [ ! -f "$TORRENT" ]; then + yellow "Missing torrent $TORRENT, generating..." + # shellcheck disable=2086 + mktorrent $TRACKERS \ + -f \ + -v \ + -d \ + -c "$(cat "_podcasts/$DATE-$SLUG.md")" \ + -n "$TITLE.ogg" \ + -w "$WEBSEED" \ + -o "$TORRENT" \ + "$OGG" + fi fi if [[ "$PREFIX" = '_screencasts/' ]]; then @@ -159,33 +158,30 @@ assert-frontmatter() { exit 1 fi - for videofmt in webm; do - DATE="$(get-date "$F")" - URL_BASENAME="$(basename "$(get-url "$F")")" - VIDEO="resources/screencasts/${DATE}-${SLUG}.$videofmt" - if [[ ! -f "$VIDEO" ]]; then - red "Missing video file '$VIDEO'." - exit 1 - fi - done + DATE="$(get-date "$F")" + URL_BASENAME="$(basename "$(get-url "$F")")" + VIDEO="resources/screencasts/${DATE}-${SLUG}.webm" + if [[ ! -f "$VIDEO" ]]; then + red "Missing video file '$VIDEO'." + exit 1 + fi - for videofmt in webm; do - WEBM="resources/screencasts/$DATE-$SLUG.webm" - TORRENT="$WEBM.torrent" - WEBSEED="https://euandre.org/$WEBM" - if [ ! -f "$TORRENT" ]; then - yellow "Missing torrent $TORRENT, generating..." - mktorrent $TRACKERS \ - -f \ - -v \ - -d \ - -c "$(cat _screencasts/$DATE-$SLUG.md)" \ - -n "$TITLE.webm" \ - -w "$WEBSEED" \ - -o "$TORRENT" \ - "$WEBM" - fi - done + WEBM="resources/screencasts/$DATE-$SLUG.webm" + TORRENT="$WEBM.torrent" + WEBSEED="https://euandre.org/$WEBM" + if [ ! -f "$TORRENT" ]; then + yellow "Missing torrent $TORRENT, generating..." + # shellcheck disable=2086 + mktorrent $TRACKERS \ + -f \ + -v \ + -d \ + -c "$(cat "_screencasts/$DATE-$SLUG.md")" \ + -n "$TITLE.webm" \ + -w "$WEBSEED" \ + -o "$TORRENT" \ + "$WEBM" + fi fi if [[ "$DESIRED_LAYOUT" != 'page' ]]; then |