diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-30 22:02:47 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-30 22:02:47 +0300 |
| commit | d7a33b2580f7456b905efa4d0787e400cf731a22 (patch) | |
| tree | 83a4b70ef479fcebdc3730e9a349f05a7507a9af /Rexfile | |
| parent | 0d6662bd488c4140803f96c3b61994ff1668fb6c (diff) | |
Add home_gitconfig task to deploy global git config on Linux
Amp-Thread-ID: https://ampcode.com/threads/T-019d401d-bdcc-75aa-a09d-5f0e1aa626c6
Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'Rexfile')
| -rw-r--r-- | Rexfile | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -267,6 +267,35 @@ task 'home_sway', sub { ensure "$DOT/waybar/*" => "$HOME/.config/waybar/"; }; +desc 'Install global git configuration'; +task 'home_gitconfig', sub { + if ( $^O eq 'linux' ) { + my %config = ( + 'user.email' => 'paul@buetow.org', + 'user.name' => 'Paul Buetow', + 'init.defaultbranch' => 'main', + 'core.editor' => 'hx', + 'core.pager' => 'delta', + 'delta.navigate' => 'true', + 'delta.side-by-side' => 'true', + 'delta.features' => 'side-by-side line-numbers decorations', + 'commit.verbose' => 'true', + 'interactive.difffilter' => 'delta --color-only', + 'diff.tool' => 'difftastic', + 'difftool.prompt' => 'false', + 'difftool.difftastic.cmd' => 'difft $LOCAL $REMOTE', + ); + + for my $key ( sort keys %config ) { + Rex::Logger::info("Setting git config $key"); + run "git config --global '$key' '$config{$key}'"; + } + } + else { + Rex::Logger::info( 'Skipping git configuration (not on Linux)', 'warn' ); + } +}; + desc 'Install my signature'; task 'home_signature', sub { ensure "$DOT/signature" => "$HOME/.signature"; |
