summaryrefslogtreecommitdiffstats
path: root/HomeBrewFormula/git-delta.rb
blob: 4ee9e51478c21afd7545983194ef19ac81052797 (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.2"
  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 "453b4652f55f86ee3aeb128e7cda3cf6cdc9fdbeac4c69a76e4c96c88a9af99b"
  elsif OS.linux?
      url "https://github.com/dandavison/delta/releases/download/#{version}/delta-#{version}-x86_64-unknown-linux-musl.tar.gz"
      sha256 "73ef55027433bb72ae2457428ae1c2807d1f807cfaa111692e58ab4f4e27b8d0"
  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 --help"
  end
end