Brew已安装,但未标识为pkgbuildMacOS的后安装脚本中的命令

问题描述

我有一个小的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识别为命令。

到目前为止我已经尝试过的事情:-

  1. 我启用了安装日志,可以看到
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
  1. 改为使用Brew二进制文件/usr/local/bin/brew绝对路径。这给了我一个不同,但是仍然是一个错误
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 (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...