yarnpkg/yarn

Aborting publish should not change version number

Open

#662 建立於 2016年10月11日

在 GitHub 查看
 (4 留言) (1 反應) (0 負責人)JavaScript (41,514 star) (2,731 fork)batch import
cat-bughelp wantedhigh-prioritytriaged

描述

Do you want to request a feature or report a bug? bug What is the current behavior? When using yarn publish and aborting after entering a version number, the version number is not reset. As a consequence it seems impossible to publish the same version number "again" without reverting the change manually. If the current behavior is a bug, please provide the steps to reproduce.

[tkloht@Tobias-Air ~/Code/react-component-scripts:master] yarn publish
yarn publish v0.15.1
[1/4] Bumping version...
info Current version: 1.4.1
question New version: 1.4.2
info New version: 1.4.2
[2/4] Logging in...
info npm username: tkloht
info npm username: tobias.kloht@gmail.com
error canceled
    at Interface.<anonymous> (/Users/tkloht/.nvm/versions/node/v6.2.1/lib/node_modules/yarnpkg/node_modules/read/lib/read.js:66:13)
    at emitNone (events.js:86:13)
    at Interface.emit (events.js:185:7)
    at Interface._ttyWrite (readline.js:707:16)
    at ReadStream.onkeypress (readline.js:115:10)
    at emitTwo (events.js:106:13)
    at ReadStream.emit (events.js:191:7)
    at emitKeys (internal/readline.js:385:14)
    at next (native)
    at ReadStream.onData (readline.js:939:36)
info Visit http://yarnpkg.com/en/docs/cli/publish for documentation about this command.

after this the version number is already changed:

diff --git a/package.json b/package.json
index e8764fc..c6d0fb4 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tkloht/react-component-scripts",
-  "version": "1.4.1",
+  "version": "1.4.2",

This makes it impossible to publish version 1.4.2 in this example:

[tkloht@Tobias-Air ~/Code/react-component-scripts:master*] yarn publish
yarn publish v0.15.1
[1/4] Bumping version...
info Current version: 1.4.2
question New version: 1.4.2
error New version is the same as the current version.
info Visit http://yarnpkg.com/en/docs/cli/publish for documentation about this command.

What is the expected behavior?

When I abort a publish the version number in package.json should not have changed.

Please mention your node.js, yarn and operating system version. node: v6.2.1, yarn: 0.15.1, OSX 10.12

貢獻者指南