当我在Rails项目中时,如何避免输入
foreman run rails console
每一次?换句话说,有没有办法自动为rails
和rake
命令添加foreman run
?
答案 0 :(得分:2)
使用bash函数:
rails () {
if test current directory is in a rails project # left as an exercise
then
foreman run rails "$@"
else
command rails "$@"
fi
}