From 2114ca17b3507375816838bd3efdb4991dc0a758 Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Sun, 8 May 2022 13:47:07 +0200 Subject: Gittab is replaced by a bashtard playbook --- .local/bin/gittab | 87 ------------------------------------------ .local/etc/gittab/basedirs | 5 --- .local/etc/gittab/tabs/awesome | 1 - .local/etc/gittab/tabs/bash | 1 - .local/etc/gittab/tabs/weechat | 4 -- .local/etc/gittab/tabs/zsh | 1 - 6 files changed, 99 deletions(-) delete mode 100755 .local/bin/gittab delete mode 100644 .local/etc/gittab/basedirs delete mode 100644 .local/etc/gittab/tabs/awesome delete mode 100644 .local/etc/gittab/tabs/bash delete mode 100644 .local/etc/gittab/tabs/weechat delete mode 100644 .local/etc/gittab/tabs/zsh (limited to '.local') diff --git a/.local/bin/gittab b/.local/bin/gittab deleted file mode 100755 index 5ffd5f9..0000000 --- a/.local/bin/gittab +++ /dev/null @@ -1,87 +0,0 @@ -#! /usr/bin/env perl6 - -use v6.d; - -constant TABDIR = $*HOME.add('.local/etc/gittab/tabs'); -constant TABCONF = $*HOME.add('.local/etc/gittab/basedirs'); - -#| Update managed git repositories -multi sub MAIN ( - #| A list of targets to update. - *@targets, -) { - @targets = TABDIR.dir.map(*.basename) unless @targets; - - for @targets -> $target { - my $tab = find-tab($target); - - note "No gittab for target '$target'" unless $tab; - - my $basedir = get-basedir($target); - - mkdir($basedir) unless $basedir.d; - - for $tab.lines.grep(!*.starts-with("#")) { - my ($name, $repo, $branch) = $_.words; - - if (!$basedir.add($name).d) { - chdir $basedir; - run « git clone --single-branch --branch "$branch" --depth 1 "$repo" "$name" »; - } - - chdir $basedir.add($name); - run « git checkout "$branch" »; - run « git pull "$repo" "$branch" »; - } - } -} - -#| List managed git repositories -multi sub MAIN ( - Bool:D :$list!, -) { - my @tabs = TABDIR.dir.map(*.basename).sort; - my $longest = @tabs.map(*.chars).sort.tail; - - for @tabs { - "%-{$longest}s %s\n".printf($_, get-basedir($_)); - } -} - -sub find-tab ( - Str:D $name, -) { - my @attempts = - $name, - $name ~ 'tab', - ; - - for @attempts { - my $fh = TABDIR.add($_); - - return $fh if $fh.f; - } - - Nil; -} - -sub get-basedir ( - Str:D $tab, -) { - state %basedirs; - - if (!%basedirs && TABCONF.e) { - TABCONF - .lines - .grep(!*.starts-with('#')) - .map({ - my ($tab, $basedir) = $_.words; - - %basedirs{$tab} = $basedir.IO; - }) - } - - return $*HOME unless %basedirs{$tab}:exists; - - $*HOME.add(%basedirs{$tab}); -} diff --git a/.local/etc/gittab/basedirs b/.local/etc/gittab/basedirs deleted file mode 100644 index ca3b53d..0000000 --- a/.local/etc/gittab/basedirs +++ /dev/null @@ -1,5 +0,0 @@ -awesome .config/awesome -bash .config/shell/vendor/bash -vim .vim/bundle -weechat .weechat/vendor -zsh .config/shell/vendor/zsh diff --git a/.local/etc/gittab/tabs/awesome b/.local/etc/gittab/tabs/awesome deleted file mode 100644 index 6414bc8..0000000 --- a/.local/etc/gittab/tabs/awesome +++ /dev/null @@ -1 +0,0 @@ -# Local name Remote URL Branch diff --git a/.local/etc/gittab/tabs/bash b/.local/etc/gittab/tabs/bash deleted file mode 100644 index 0940d13..0000000 --- a/.local/etc/gittab/tabs/bash +++ /dev/null @@ -1 +0,0 @@ -feature-auto-completion https://github.com/scop/bash-completion.git master diff --git a/.local/etc/gittab/tabs/weechat b/.local/etc/gittab/tabs/weechat deleted file mode 100644 index 27b21eb..0000000 --- a/.local/etc/gittab/tabs/weechat +++ /dev/null @@ -1,4 +0,0 @@ -# Local name Remote URL Branch -protocol-slack https://github.com/wee-slack/wee-slack master -protocol-matrix https://github.com/poljar/weechat-matrix master -protocol-signal https://github.com/thefinn93/signal-weechat master diff --git a/.local/etc/gittab/tabs/zsh b/.local/etc/gittab/tabs/zsh deleted file mode 100644 index 8f98e73..0000000 --- a/.local/etc/gittab/tabs/zsh +++ /dev/null @@ -1 +0,0 @@ -feature-syntax-highlighting https://github.com/zsh-users/zsh-syntax-highlighting.git master -- cgit v1.1