blob: 110d39a8a05e9c4794afd907dbec0984d99a1aed (
plain) (
tree)
|
|
#!/bin/bash
# {{ ansible_managed }}
SLUG=$1
FILE=$2
TALKS_JSON=${3:-~/current/talks.json}
filename=$(basename -- "$FILE")
extension="${filename##*.}"
filename="${filename%.*}"
FILE_PREFIX=$(jq -r '.talks[] | select(.slug=="'$SLUG'")["file-prefix"]' < $TALKS_JSON)
mv "$FILE" $FILE_PREFIX--original.$extension
if [ -f $FILE_PREFIX--original.webm ] && [ ! -f $FILE_PREFIX--main.$extension ]; then
cp $FILE_PREFIX--original.$extension $FILE_PREFIX--main.webm
fi
|