Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): exec should not log usage info when inner command fails #14237

Merged
merged 1 commit into from Jan 11, 2023

Conversation

AgentEnder
Copy link
Member

@AgentEnder AgentEnder commented Jan 9, 2023

Current Behavior

When a command ran through nx exec fails, the output of nx exec --help is logged out twice.

Expected Behavior

Failing inner commands from nx exec should not log usage text.

agentender@DESKTOP-RFT62G1:~/nx$ npm run check-commit

> check-commit
> nx exec -- echo 'oh no'; exit 1

yarn run v1.22.19
$ /home/agentender/nx/node_modules/.bin/nx run '@nrwl/nx-source:"check-commit"'

> nx run @nrwl/nx-source:check-commit

$ nx exec -- echo 'oh no'; exit 1
oh no
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

 —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  NX   Ran target undefined for project @nrwl/nx-source (781ms)
 
    ✖    1/1 failed
    ✔    0/1 succeeded [0 read from cache]
 
   View structured, searchable error logs at https://staging.nx.app/runs/hjUZVmJiFD

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Related Issue(s)

Fixes #14202

@vercel
Copy link

vercel bot commented Jan 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
nx-dev ✅ Ready (Inspect) Visit Preview Jan 9, 2023 at 10:22PM (UTC)

@FrozenPandaz FrozenPandaz merged commit 0636fe7 into nrwl:master Jan 11, 2023
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nx exec prints the help docs multiple times when executed command returns non-zero exit code
2 participants