【发布时间】:2019-06-09 17:45:45
【问题描述】:
感谢这篇文章,我尝试为 gitlab 编写私人自制水龙头:https://wheniwork.engineering/creating-a-private-homebrew-tap-with-gitlab-8800c453d893
这是我的公式:
class Pouet < Formula
desc "Pouet command line utility"
homepage "https://gitlab.mycompany.com/martin/Pouet"
url "https://gitlab.mycompany.com/api/v4/projects/0000017/repository/archive?private_token=#{ENV['HOMEBREW_GITLAB_TOKEN']}"
version "1.0"
sha256 "ffdb029ada6d03fe3fa323577693cc233ef3d2300784a8d79077cecf6df7a470"
def install
system "echo", ENV["HOMEBREW_GITLAB_TOKEN"]
end
test do
pouet --help
end
end
我在我的环境中定义了HOMEBREW_GITLAB_TOKEN,因此可以从我启动brew 命令的shell 访问它。
很遗憾,下载失败,因为 HOMEBREW_GITLAB_TOKEN 变量在 brew 进程中未知。
有什么想法吗?
【问题讨论】:
-
你是如何定义环境变量的?出口了吗?
-
是的(见我的编辑)
标签: ruby environment-variables homebrew