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

yarn run --non-interactive prompts and errors #5655

Closed
RoBorg opened this issue Apr 12, 2018 · 2 comments
Closed

yarn run --non-interactive prompts and errors #5655

RoBorg opened this issue Apr 12, 2018 · 2 comments

Comments

@RoBorg
Copy link

RoBorg commented Apr 12, 2018

Do you want to request a feature or report a bug?: Bug

What is the current behavior?
yarn run --non-interactive gives errors and is interactive

If the current behavior is a bug, please provide the steps to reproduce.

$ yarn run --non-interactive
yarn run v1.6.0
error No command specified.
info Commands available from binary scripts: acorn, --SNIP--
info Project commands
   - dev
      gulp watch
   - prod
      gulp --production
question Which command would you like to run?:

What is the expected behavior?

  1. The error No command specified. message should not be printed as yarn run with no command is supposed to list available commands
  2. The question Which command would you like to run?: should not appear with --non-interactive specified

Please mention your node.js, yarn and operating system version.
node v8.9.4, yarn v1.6.0 (same on v1.5.1), Windows 10

@BhaveshSGupta
Copy link

@rally25rs, I would love to try to solve this.

@rally25rs rally25rs removed the triaged label Apr 24, 2018
BYK pushed a commit that referenced this issue Apr 26, 2018
**Summary**

This pr fixes a bug ([#5655](#5655)) in which `yarn run --non-interactive` prints a `Error: No command specified` message and also suppresses the message `question Which command would you like to run?:` when running non-interactively. 

**Test plan**

```
> yarn-local run --non-interactive
yarn run v1.6.0
info Commands available from binary scripts: acorn, atob, babylon, browserslist, commitizen, detect-libc, errno, escodegen, esgenerate, eslint, esparse, esvalidate, flow, git-cz, git-release-notes, gulp, gunzip-maybe, handlebars, import-local-fixture, jest, jest-runtime, js-yaml, jsesc, jsinspect, json5, loose-envify, miller-rabin, mkdirp, node-pre-gyp, nopt, prettier, rc, regjsparser, rimraf, sane, semver, sha.js, shjs, sshpk-conv, sshpk-sign, sshpk-verify, strip-indent, strip-json-comments, uglifyjs, user-home, uuid, watch, webpack, which
info Project commands
   - build
      gulp build
   - build-bundle
      node ./scripts/build-webpack.js
   - build-chocolatey
      powershell ./scripts/build-chocolatey.ps1
   - build-deb
      ./scripts/build-deb.sh
   - build-dist
      bash ./scripts/build-dist.sh
   - build-win-installer
      scripts\build-windows-installer.bat
   - changelog
      git-release-notes $(git describe --tags --abbrev=0 $(git describe --tags --abbrev=0)^)..$(git describe --tags --abbrev=0) scripts/changelog.md
   - commit
      git-cz
   - dupe-check
      yarn jsinspect ./src
   - lint
      eslint . && flow check
   - pkg-tests
      yarn --cwd packages/pkg-tests jest yarn.test.js
   - prettier
      eslint src __tests__ --fix
   - release-branch
      ./scripts/release-branch.sh
   - test
      yarn lint && yarn test-only
   - test-coverage
      node --max_old_space_size=4096 node_modules/jest/bin/jest.js --coverage --verbose
   - test-only
      node --max_old_space_size=4096 node_modules/jest/bin/jest.js --verbose
   - watch
      gulp watch
✨  Done in 0.28s.
```
@paul-soporan
Copy link
Member

Closed in #5694.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants