-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvim-plugin
More file actions
executable file
·44 lines (33 loc) · 787 Bytes
/
vim-plugin
File metadata and controls
executable file
·44 lines (33 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
set -e
command="$1"
shift
case "$command" in
"install")
if [[ -z "$1" ]]; then
echo "please provide a <repo>" >&2
exit 1
fi
repo="$1"
branch="$2"
name="$(grep -Po '[^\/]+$' <<<"$repo")"
path="conf_common/.local/share/nvim/site/pack/plugins/start/$name"
extra_args=()
test -n "$branch" && extra_args=(-b "$branch")
git submodule add "${extra_args[@]}" -f "$repo" "$path"
;;
"uninstall")
if [[ -z "$1" ]]; then
echo "please provide a <name>" >&2
exit 1
fi
name="$1"
path="conf_common/.local/share/nvim/site/pack/plugins/start/$name"
git submodule deinit -f "$path"
git rm -f "$path"
;;
*)
echo "unknown <command> \"$command\"" >&2
exit 1
;;
esac