Drush command exit code

Created on 18 September 2020, over 4 years ago
Updated 29 October 2023, over 1 year ago

Problem/Motivation

Failed "drush csim" command should return proper exit code so it can be easily recognized during automatic deployment ex. using gitlab-ci. Right now it always returns 0.

Installed module version: 1.5
Drush version: 10.3.4 (also tested on 9.7)

Steps to reproduce

1. Export configuration.
2. Add non-existing module into core.extension.yml
3. Run "drush csim -y"

wodby@php.container:/var/www/html $ drush csim -y

 Please consider using `drush config:import` instead for importing all config.

 // Do a normal (including filters) config import?: yes.                                                                

                                                                                                                        
 [ERROR] There have been errors importing: Unable to install the this_module_is_not_found module since it does not      
         exist.                                                                                                         
                                                                                                                       

4. Run "echo $?"

wodby@php.container:/var/www/html $ echo $?
0

Desired result for latest command is non-zero value.

Proposed resolution

Attached patch.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇵🇱Poland nexus246

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024