문제

When I'm in a Rails project, how do I save myself from typing

foreman run rails console

every time? In other words, is there a way to automatically prefix rails and rake commands with foreman run automatically?

도움이 되었습니까?

해결책

Use a bash function:

rails () {
    if test current directory is in a rails project  # left as an exercise
    then
        foreman run rails "$@"
    else
        command rails "$@"
    fi
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top