diff options
author | EuAndreh <eu@euandre.org> | 2020-12-24 13:20:54 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2020-12-24 13:20:54 -0300 |
commit | ae627518cca4dd296946f393a506a63298a8d9f6 (patch) | |
tree | f7bcbf0abe61eed64f0e37dccfffc6a69407c0a5 | |
parent | Add support for screencasts, behind a feature flag (diff) | |
download | euandre.org-ae627518cca4dd296946f393a506a63298a8d9f6.tar.gz euandre.org-ae627518cca4dd296946f393a506a63298a8d9f6.tar.xz |
Fix ShellCheck errors
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 |