# -m IMAGE_FILE = Uploads IMAGE_FILE. if MEDIA_FILE.txt exists, the last line of that file will be used as ALT_TEXT
# unless -a has been used.
pdt() {
- local video media twitter_account gs_account mastodon_account video gs_arg alt_text network
+ local video media twitter_account gs_account mastodon_account video gs_arg network
local do_mastodon do_twitter do_gnusocial
local -a toot_args
if [[ $pdttest ]]; then
;;
-a)
alt_text="$2"
- toot_args+=(--description "$alt_text" )
shift 2
;;
-m)
if [[ ! $alt_text && -r $media.txt && -s $media.txt ]]; then
alt_text=$(tail -n1 $media.txt)
fi
+ if [[ $alt_text ]]; then
+ toot_args+=(--description "$alt_text" )
+ fi
fi
# if we have no argument
if (( ! $# )); then
# generally only meant to be called internally from pdt-setup
pdt-twitter-setup() {
- # twitter setup
+ # twitter setup
mkdir -p ~/src/twitter
cd ~/src/twitter
python3 -m virtualenv -p python3 venv