summaryrefslogtreecommitdiffstats
path: root/HomeBrewFormula/git-delta.rb
blob: cd7da2dee2953831985227f1f6314b7f3abe3406 (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.15"
  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 "d99153513940b2ce599a7913a8682403e507e2bf254abd50da560aae02f5329d"
  elsif OS.linux?
      url "https://github.com/dandavison/delta/releases/download/#{version}/delta-#{version}-x86_64-unknown-linux-musl.tar.gz"
      sha256 "88034f84ae4d26ea5c61961dfa8f5384aa196911b9b64018181d1cd822b5ddcd"
  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