Skip to content

chore(cli): don't ask questions during publish when --non-interactive is specified (#5002) - #5108

Merged
bestander merged 2 commits into
yarnpkg:masterfrom
iansu:fix-5002
Feb 17, 2018
Merged

bestander merged 2 commits into
yarnpkg:masterfrom
iansu:fix-5002

Conversation

@iansu

@iansu iansu commented Dec 19, 2017

Copy link
Copy Markdown
Contributor

Summary

Running publish with --non-interactive should not prompt for input and should fail if required args like --new-version are not provided.

Fixes #5002

Test plan

  • Run yarn publish --non-interactive and see error message about not providing --new-version
  • Delete NPM token, run yarn publish --non-interactive --new-version=1.0.1 and see error message about not being able to ask for login due to --non-interactive flag

@buildsize

buildsize Bot commented Dec 19, 2017 •

Copy link
Copy Markdown

This change will increase the build size from 10.39 MB to 10.4 MB, an increase of 2.03 KB (0%)

File name Previous Size New Size Change
yarn-[version].noarch.rpm 900.2 KB 900.41 KB 220 bytes (0%)
yarn-[version].js 3.91 MB 3.92 MB 754 bytes (0%)
yarn-legacy-[version].js 4.06 MB 4.06 MB 831 bytes (0%)
yarn-v[version].tar.gz 905.32 KB 905.51 KB 195 bytes (0%)
yarn_[version]all.deb 669.15 KB 669.22 KB 74 bytes (0%)

@gandazgul

Copy link
Copy Markdown
Contributor

What if instead of requiring --new-version it publishes as is? I'm still using npm publish because I can't use yarn publish from CI.

@castarco

Copy link
Copy Markdown

Maybe the branch of this PR should be rebased to avoid having a broken commit. Having broken commits is a problem when someone tries to do a git bisect search.

@bestander

Copy link
Copy Markdown
Member

Thanks, @iansu, very much appreciated!

@bestander
bestander merged commit 0f713c1 into yarnpkg:master Feb 17, 2018
@bestander

Copy link
Copy Markdown
Member

@castarco, we squash commits when merge, so it should not be a problem

@bestander

Copy link
Copy Markdown
Member

@gandazgul, I think there is a separate issue open for your point.
I actually would like to have an ability to bump version and publish as separate commands

@adamscybot

adamscybot commented Apr 5, 2018 •

Copy link
Copy Markdown

@iansu I think this has caused a regression.

should fail if required args like --new-version are not provided.

In previous versions, version is not a required field. See this PR #3103 and the related issue it fixed which enabled --new-version to not be specified #3011.

This functionality allows people who are doing things like publishing from shell scripts or CI to use yarn to publish.

@adamscybot

adamscybot commented Apr 5, 2018 •

Copy link
Copy Markdown

Scratch that, looks like I confused some similar sounding issues. Looks like it has never been possible to skip version bump.

@rafambbr

Copy link
Copy Markdown

yarn publish --registry=http://mynexus:8081/repository/yarn-repo/ --access public --non-interactive --new-version 0.0.4

@janosh

janosh commented Jul 23, 2021

Copy link
Copy Markdown

There should be a non-interactive mode that doesn't require passing in a new version. What if the version was already bumped beforehand?

@merceyz

merceyz commented Jul 25, 2021

Copy link
Copy Markdown
Member

Create a new issue, please don't bump a three year old PR

@yarnpkg yarnpkg locked as resolved and limited conversation to collaborators Jul 25, 2021
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.

yarn publish --non-interactive still asks questions

8 participants