在新電腦中,homebrew可以幫助我們很好地管理電腦中的軟件顾稀。
1.創(chuàng)建brew.sh文件镶骗,把下面的腳本貼到文件中
#!/bin/bash
# 判斷是否為MacOS包竹,是則安裝homebrew
if [ "$(uname)" = "Darwin" ] ; then
# MacOS
if ! type brew >/dev/null 2>/dev/null; then
echo "---start install homebrew---"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
echo "---start upgrade homebrew---"
fi
else
# Linux
echo "homebrew The missing package manager for macOS"
fi
# Make sure we’re using the latest Homebrew.
brew update
# Upgrade any already-installed formulae.
brew upgrade
# 常用的命令行工具安裝
brew install vim
#常用的工具包安裝
brew install --cask java
brew install --cask iterm2
brew install --cask google-chrome
brew install --cask postman
brew install --cask xmind-zen
brew install --cask wechat
brew install --cask wechatwork
brew install --cask slack
brew install --cask charles
brew install --cask neteasemusic
brew install --cask qqmusic
brew install --cask wpsoffice
brew cleanup
2.執(zhí)行shell腳本,sh brew.sh
就可以安裝Homewbrew以及相關(guān)的軟件了查库。
也可以根據(jù)自身的需要路媚,把一些沒用到的軟件去掉即可。
希望腳本可以幫助你更好管理新mac電腦