【发布时间】:2014-01-15 03:24:00
【问题描述】:
我即将编写一个shell脚本来检测系统中是否安装了几个自制软件包。有没有办法使用 brew 命令来实现这一点?
我尝试使用brew install <formula> --dry-run 的退出代码。但是,如果它丢失,这会构建包。
【问题讨论】:
-
brew --cellar "$formula" >/dev/null 2>&1--cellar formula: Display the location in the cellar where formula would be installed, without any sort of versioned directory as the last path.brew man page;很想给它作为答案 -
if [ ! -x "$(command -v PKG_EXEC)" ]; then # package not installed fi