aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/vimbundle
blob: 27406fe51455fb2c598438f0ff4863b0a5c32567 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /usr/bin/env perl6

#| Update installed bundles for vim.
sub MAIN ()
{
	my $bundletab = $*HOME.add(".vim/bundletab");
	my $bundledir = $*HOME.add(".vim/bundle");

	die "No bundletab!" unless $bundletab.e;

	for $bundletab.lines.grep(!*.starts-with("#")) {
		my ($name, $repo, $branch) = $_.words;

		if (!$bundledir.add($name).d) {
			chdir $bundledir;
			run « git clone --single-branch --branch "$branch" --depth 1 "$repo" "$name" »;
		}

		chdir $bundledir.add($name);
		run « git switch "$branch" »;
		run « git pull origin "$branch" »;
	}
}