上面说的 2 个方法都行,但我还是习惯自己设置 alias
if [ -d '/Applications/Visual Studio Code.app' ]; then
alias vs="open -a '/Applications/Visual Studio Code.app'"
fi
if [ -d '/Applications/IntelliJ IDEA.app' ]; then
alias idea="open -a '/Applications/IntelliJ IDEA.app'"
fi
if [ -d '/Applications/WebStorm.app' ]; then
alias webstorm="open -a '/Applications/WebStorm.app'"
fi
if [ -d '/Applications/GoLand.app' ]; then
alias goland="open -a '/Applications/GoLand.app'"
fi |