fix after_result code

only add :after_success, :deploy, or :after_failure code if there is code to add, otherwise we create empty if/fi blocks, which bash doesn’t like