aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-12-24 13:20:54 -0300
committerEuAndreh <eu@euandre.org>2020-12-24 13:20:54 -0300
commitae627518cca4dd296946f393a506a63298a8d9f6 (patch)
treef7bcbf0abe61eed64f0e37dccfffc6a69407c0a5
parentAdd support for screencasts, behind a feature flag (diff)
downloadeuandre.org-ae627518cca4dd296946f393a506a63298a8d9f6.tar.gz
euandre.org-ae627518cca4dd296946f393a506a63298a8d9f6.tar.xz
Fix ShellCheck errors
-rwxr-xr-xscripts/assert-content.sh82
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