65 lines
1.0 KiB
Bash
Executable File
65 lines
1.0 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ $# -eq 0 ]; then
|
|
echo 'error: argument required (action), one of: clone, fetch, merge' >&2
|
|
exit 1
|
|
fi
|
|
|
|
ACTION="$1"
|
|
PLUGINS_DIR=$(dirname $(realpath "$0"))/plugins
|
|
|
|
cd "$PLUGINS_DIR"
|
|
|
|
action() {
|
|
case "$1" in
|
|
*:*)
|
|
P="$1"
|
|
|
|
;;
|
|
*)
|
|
P="https://github.com/$1"
|
|
;;
|
|
esac
|
|
B=$(basename "$1")
|
|
B="${B%.git}"
|
|
case "$ACTION" in
|
|
clone)
|
|
if [ ! -e "$B" ]; then
|
|
echo "$ACTION $B"
|
|
git clone "$P"
|
|
fi
|
|
;;
|
|
fetch)
|
|
if [ -e "$B" ]; then
|
|
echo "$ACTION $B"
|
|
git -C "$B" fetch
|
|
fi
|
|
;;
|
|
merge)
|
|
if [ -e "$B" ]; then
|
|
echo "$ACTION $B"
|
|
git -C "$B" merge
|
|
fi
|
|
;;
|
|
*)
|
|
echo "error: unsupported action: $ACTION" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
}
|
|
|
|
for plugin in \
|
|
'https://gitlab.com/muhq/vis-lspc' \
|
|
'lutobler/vis-commentary' \
|
|
'https://repo.or.cz/vis-surround.git' \
|
|
'peaceant/vis-fzf-mru' \
|
|
'https://gitlab.com/muhq/vis-build' \
|
|
'erf/vis-cursors' \
|
|
'thimc/vis-colorizer' \
|
|
'https://repo.or.cz/vis-quickfix.git' \
|
|
'https://repo.or.cz/vis-pairs.git' \
|
|
'https://gitea.lupan.pl/lupan/vis-pin-files.git'; \
|
|
do
|
|
action "$plugin"
|
|
done
|