Skip to content

Instantly share code, notes, and snippets.

@zhuweiyou
Last active September 20, 2023 15:28
Show Gist options
  • Save zhuweiyou/b3e80a0a5f0a2d36fca64eefa025b717 to your computer and use it in GitHub Desktop.
Save zhuweiyou/b3e80a0a5f0a2d36fca64eefa025b717 to your computer and use it in GitHub Desktop.
idea 命令, 快捷打开文件或者文件夹
#!/bin/bash
# 判断是否传递了参数
if [ $# -eq 0 ]; then
/Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea . > /dev/null 2>&1
else
/Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea "$@" > /dev/null 2>&1
fi
# 文件保存到 /usr/local/bin/idea 并给执行权限
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment