我写了我的第一个水龙头,所以我仍然不确定它是如何工作的。我写了这个小公式:
class Konversation < Formula
desc "Konversation is a tool to generate rich and diversified responses to the user of a voice application."
homepage "https://github.com/rewe-digital-incubator/Konversation/"
url "https://github.com/rewe-digital-incubator/Konversation/releases/download/1.0.0/konversation-cli.jar"
sha256 "6123d126278faae2419f5de00411a1b67ae57e0cf2265a5d484ed6f9786baaca"
def install
prefix.install "#{buildpath}/konversation-cli.jar"
File.write("#{buildpath}/konversation", "java -jar #{prefix}/konversation-cli.jar $@")
bin.install "#{buildpath}/konversation"
system "chmod", "+x", "#{bin}/konversation"
end
end
但是我无法运行我的工具,因为“konversation”可执行文件没有 x 权限。我试图用系统 chmod 来解决这个问题,但是我看到我的 x 标志在安装后被 brew 作为某种清理删除:
==> Cleaning
Fixing /home/linuxbrew/.linuxbrew/opt/konversation/bin/konversation permissions from 777 to 444
如何正确设置文件权限?
请注意,我不想将 shell 脚本本身托管在某个地方,因为我没有看到将 shell 脚本和 jar 文件打包到另一个 zip 文件中以防贫乏。
如果您想自己尝试,请尝试以下命令:
brew install rekire/packages/konversation