aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/vimbundle
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/vimbundle')
-rwxr-xr-x.local/bin/vimbundle23
1 files changed, 23 insertions, 0 deletions
diff --git a/.local/bin/vimbundle b/.local/bin/vimbundle
new file mode 100755
index 0000000..27406fe
--- /dev/null
+++ b/.local/bin/vimbundle
@@ -0,0 +1,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" »;
+ }
+}