Foreman running guard with color ouput

后端 未结 3 1475
醉梦人生
醉梦人生 2021-02-03 13:47

I can run guard from within my foreman procfile - but the output is not as colorful as I\'d like. The only color I see in my output is from Foreman...

I want to have a

3条回答
  •  长发绾君心
    2021-02-03 14:13

    EDIT: Even simpler, in Guardfile do

    guard :rspec, cmd: "rspec --force-color"
    
    # In case you do --profile and dot in regular .rspec, you may want to override further:
    guard :rspec, cmd: "rspec --force-color --no-profile --format documentation"
    

    /EDIT

    I struggled with this and got it running with RSpec 3.8, rails 5.2 and foreman 0.64

    Two configs must be done to make it work.

    # In .rspec, add
    --color
    
    # In Guardfile, change to
    guard :rspec, cmd: "rspec --tty" do
    

    It's confusing why --color and tty are needed, the official rspec documentation says that both tty and color are default enabled.

    Endnote: if you are doing this, running guard with foreman, it tells me a lot about what kind of developer you are. Say no more ;)

提交回复
热议问题