1 Star 0 Fork 2

Alex/macOS

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
sshpass-install.sh 866 Bytes
一键复制 编辑 原始数据 按行查看 历史
Alex 提交于 2022-04-01 02:49 . update sshpass-install.sh.
#!/bin/bash
SPATH=/usr/local/Cellar/sshpass/1.06/bin
ZRC=~/.zshrc
# define function
function create_rb {
cat > sshpass.rb <<EOF
heredoc> require 'formula'
class Sshpass < Formula
url 'http://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz'
homepage 'http://sourceforge.net/projects/sshpass'
sha256 'c6324fcee608b99a58f9870157dfa754837f8c48be3df0f5e2f3accf145dee60'
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make install"
end
def test
system "sshpass"
end
end
heredoc> EOF
}
function path_mod {
if grep -qw ^PATH $ZRC; then
sed -i.bk "/^PATH/s|$|$SPATH|" $ZRC
else
sed -i.bk "1iPATH=\$PATH:$SPATH" $ZRC
fi
}
# Main area
create_rb
brew install sshpass.rb
path_mod
sourc $ZRC
echo
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/suzhen99/macos.git
[email protected]:suzhen99/macos.git
suzhen99
macos
macOS
master

搜索帮助