问题描述
我有一个小的Shell脚本,如果尚未安装Brew
,则会安装它。
#!/bin/bash -v
which -s brew
if [[ $? != 0 ]] ; then
# Install Homebrew
echo "Installing Brew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
echo "I don't think brew is installed..."
else
brew update
fi
当我将脚本作为独立的shell脚本运行时,该脚本运行良好。因此,我尝试使用pkgbuild
实用程序创建一个包。但是,即使安装了Brew
,一旦进入软件包,相同的脚本也无法将Brew识别为命令。
到目前为止我已经尝试过的事情:-
- 我启用了安装日志,可以看到
Sep 29 22:48:32 installd[80453]: ./postinstall:
/tmp/PKInstallSandBox.42j7tU/Scripts/org.mybinary.0.0.4.sDKM7K/postinstall:
line 16: brew: command not found
Sep 30 10:01:22 installd[90276]: ./postinstall: Error: Running Homebrew as root is extremely dangerous and no longer supported.
Sep 30 10:01:22 installd[90276]: ./postinstall: As Homebrew does not drop privileges on installation you would be giving all
Sep 30 10:01:22 installd[90276]: ./postinstall: build scripts full access to your system.
我想念什么?
谢谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)