melos icon indicating copy to clipboard operation
melos copied to clipboard

fix: improper errored exit code propagation

Open mrverdant13 opened this issue 2 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues.

Version

3.0.1

Description

When a command is run for a set of packages with the exec option, if the command exits with a non-zero code, the melos CLI does not propagate the failure result with an errored exit code.

Steps to reproduce

  1. In a mono-repo with at least two packages.
  2. Create the melos.yaml file with the basic Melos setup.
  3. Define the following script:
    should-fail:
      description: A script that should fail.
      run: dart run absent_file.dart
      exec:
        concurrency: 1
        failFast: true
      packageFilters:
        scope: "*"
    
  4. Run melos run should-fail --no-select.

Expected behavior

When running melos run should-fail, Melos should stop the whole execution with an errored exit code.

Given that the absent_file.dart file does not exist, the actual Melos execution workflow is interrupted in the first package but Melos ends up printing a SUCCESS message.

Screenshots

image

Additional context and comments

  • OS: Windows
  • Dart: 3.0.0
  • Terminal: Git Bash

mrverdant13 avatar May 19 '23 18:05 mrverdant13

I have the same issue. Would be good if this can be fixed. It also happens on macOS.

bvoq avatar Aug 30 '24 14:08 bvoq