Skip to content

Instantly share code, notes, and snippets.

@shibafu528
Last active December 22, 2021 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shibafu528/55fcb76ba54561b69584f3c50199d595 to your computer and use it in GitHub Desktop.
Save shibafu528/55fcb76ba54561b69584f3c50199d595 to your computer and use it in GitHub Desktop.
mikutter 5.0でアップデートが必要なプラグインの一部を自動更新するスクリプト
#!/bin/sh
if [ -z "$MIKUTTER_CONFROOT" ]; then
MIKUTTER_CONFROOT="$HOME/.mikutter"
fi
echo "MIKUTTER_CONFROOT: $MIKUTTER_CONFROOT"
if [ ! -d "$MIKUTTER_CONFROOT" ]; then
echo "MIKUTTER_CONFROOT does not exist."
exit 1
fi
GTK3_PLUGINS="
mikutter/twitter
mikutter/followingcontrol
mikutter/list_for_profile
mikutter/list_settings
mikutter/message_detail_view
mikutter/message_retweet
mikutter/user_detail_view
tsutsui/mikutter-uwm-hommage
shibafu528/mikutter-subparts-image
@shibafu528/mikutter_mastodon_postbox_visibility
"
for plugin in $GTK3_PLUGINS; do
# starts with "@" -> delete "mikutter-" prefix from slug
if echo "$plugin" | grep -e "^@" > /dev/null 2>&1; then
plugin="${plugin#@}"
slug="${plugin##*/}"
slug="$(echo "$slug" | sed -e "s/^mikutter[_-]//")"
else
slug="${plugin##*/}"
fi
url="https://github.com/$plugin"
plugin_dir="$MIKUTTER_CONFROOT/plugin/$slug"
backup_dir="$plugin_dir.gtk2"
if [ -d "$plugin_dir" ]; then
echo "==> Update $slug"
if [ -d "$backup_dir" ]; then
echo " -> Backup already exists!! Skip it."
continue
fi
mv "$plugin_dir" "$backup_dir" && git clone "$url.git" "$plugin_dir"
status=$?
if [ $status -eq 0 ]; then
echo " -> Success."
else
echo " -> Failed! Please update manually. (exit status = $status)"
echo " Website: $url"
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment