Homebrew +创建包:如何将文件移动到$ PATH中的某个位置?

时间:2016-10-17 19:35:06

标签: homebrew

我正在尝试按照本教程在主页上提供我的脚本:http://formalfriday.club/2015/01/05/creating-your-own-homebrew-tap-and-formula.html

class GitRedate < Formula
  desc "Change the dates of several git commits with a single command"
  homepage "https://github.com/PotatoLabs/git-redate"
  url "https://github.com/PotatoLabs/git-redate/archive/1.0.0.tar.gz"
  version "1.0.0"
  sha256 "336cf331429f2e0e030e5fe28bc00a4585dc6084b6937f0d73bc5431715a8506"

  def install
    // what do i put here to move the git-redate file so that it's loaded in the $PATH ?
  end
end

我需要将git-redate文件移动到$ PATH中的一个目录中。我该怎么做?

1 个答案:

答案 0 :(得分:1)

你自己不必担心:

def install
  bin.install 'package_name'
end

会告诉brew在brew的bin文件夹中安装'package_name'(在您的情况下,我认为是'git-redate'),该文件夹应该已经在用户的$PATH上。