gmgauthier.com/push-asset

26 lines
582 B
Plaintext
Raw Normal View History

2022-06-12 16:57:12 +00:00
#!/usr/bin/env bash
if [[ -z "$1" ]]; then
echo "Supply a file with full path to be published"
exit 1
fi
2022-12-25 10:23:41 +00:00
file=$(basename "${1}")
2022-06-12 16:57:12 +00:00
# The assumption is all images are for the blog
if [[ "$1" =~ .*\.(gif|jpg|png) ]]; then
s3cmd put -P ${1} s3://gmgauthier/blog/img/${file}
fi
# The assumption is all audio is for the podcast
if [[ "$1" =~ .*\.(mp3|ogg|wav) ]]; then
s3cmd put -P ${1} s3://gmgauthier/podcast/audio/${file}
fi
# The assumption is all video is generic
if [[ "$1" =~ .*\.(mp4|mkv|m4v) ]]; then
s3cmd put -P ${1} s3://gmgauthier/videos/${file}
fi