Capistrano & Bash: ignore command exit status

前端 未结 7 587
礼貌的吻别
礼貌的吻别 2021-01-31 14:11

I\'m using Capistrano run a remote task. My task looks like this:

task :my_task do
  run \"my_command\"
end

My problem is that if my_comm

7条回答
  •  抹茶落季
    2021-01-31 14:49

    I find the easiest option to do this:

    run "my_command || :"
    

    Notice: : is the NOP command so the exit code will simply be ignored.

提交回复
热议问题