personal-blog/push-asset

26 lines
594 B
Plaintext
Raw Permalink 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
2022-12-25 11:17:08 +00:00
s3cmd put -P "${1}" s3://gmgauthier/blog/img/"${file}"
2022-06-12 16:57:12 +00:00
fi
# The assumption is all audio is for the podcast
if [[ "$1" =~ .*\.(mp3|ogg|wav) ]]; then
2022-12-25 11:17:08 +00:00
s3cmd put -P "${1}" s3://gmgauthier/podcast/audio/"${file}"
2022-06-12 16:57:12 +00:00
fi
# The assumption is all video is generic
if [[ "$1" =~ .*\.(mp4|mkv|m4v) ]]; then
2022-12-25 11:17:08 +00:00
s3cmd put -P "${1}" s3://gmgauthier/videos/"${file}"
2022-06-12 16:57:12 +00:00
fi