Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我创建了一个命令行 ruby gem 并希望有 bash 或 zsh 完成。我创建了它们并对其进行了版本控制,但我必须手动获取它们。
是否有在 gem 安装后执行脚本的常用方法,例如编辑 bashrc 或 zshrc 并添加源命令?
如果您使用的是红宝石:
安装脚本后,放置在./bin/文件夹中的脚本应自动出现在/usr/bin/文件夹中。
./bin/
/usr/bin/
zsh并自动建议我竞争所有放置在bash目录中的命令。OS X/usr/bin/
zsh
bash
OS X
可能的问题,可能会阻止您的 gem 的代码完成:
chmod +x file