Foreman running guard with color ouput

后端 未结 3 1441
醉梦人生
醉梦人生 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:06

    Add the --tty option to your rspec guard cli:

    guard "rspec", :version => 2, :cli => "--tty ...other options..."
    
    0 讨论(0)
  • 2021-02-03 14:12

    For version 4.5.0 of guard-rspec the following worked for me

    guard :rspec, cmd_additional_args: "--tty", cmd: ...other...
    
    0 讨论(0)
  • 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 ;)

    0 讨论(0)
提交回复
热议问题