summaryrefslogtreecommitdiffstats
path: root/HomeBrewFormula/git-delta.rb
blob: 17de74dd9f1dacc4aa56a5159757d876c42d2882 (plain)
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
class GitDelta < Formula
  version "0.0.10"
  desc "A syntax-highlighting pager for git"
  homepage "https://github.com/dandavison/delta"

  if OS.mac?
      url "https://github.com/dandavison/delta/releases/download/#{version}/delta-#{version}-x86_64-apple-darwin.tar.gz"
      sha256 "c360a06c3a09a7b6b3cedf33c64520722314a1bc94198268df93759e83788a34"
  elsif OS.linux?
      url "https://github.com/dandavison/delta/releases/download/#{version}/delta-#{version}-x86_64-unknown-linux-musl.tar.gz"
      sha256 "66900d7bcff3ec85a0b56578e46578a55d45b986ef3e9f9074471be6d93e9e20"
  end

  conflicts_with "delta"

  def install
    bin.install "delta"
    ohai "To configure git to use delta, run:"
    ohai "git config --global core.pager \"delta --dark\"  # --light for light terminal backgrounds"
  end

  test do
    shell_output "#{bin}/delta --compare-themes"
  end
end