Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2010-07-19 12:09:27 +0400
committerisaacs <i@izs.me>2010-07-19 12:09:27 +0400
commit62f9dfa33f872855129b506d06b9d7206806118a (patch)
tree53b1261583453b6ae09d29e7e1068028c5bda7cd
parent8df62cb39b8ebcacabe9f837f196bea7b3c46254 (diff)
Don't upload version data unless the tarball succeeds
-rw-r--r--lib/utils/registry/publish.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/utils/registry/publish.js b/lib/utils/registry/publish.js
index 6d8c90c41..5ccf2fb26 100644
--- a/lib/utils/registry/publish.js
+++ b/lib/utils/registry/publish.js
@@ -33,7 +33,6 @@ function publish (data, cb) {
}
]
}
- fullData.versions[ data.version ] = data
data._id = data.name+"-"+data.version
var attURI = encodeURIComponent(data.name)
+ "/-/"
@@ -57,7 +56,6 @@ function publish (data, cb) {
) {
return log.er(cb, "Failed PUT response "+(response && response.statusCode))(er)
}
- var sendVersionAgain = !!er
GET(encodeURIComponent(data.name), function (er, d) {
if (er) return cb(er)
@@ -68,7 +66,7 @@ function publish (data, cb) {
attURI += "/" + rev
upload(attURI, tarball, function (er) {
log("back from upload", "publish")
- if (er || !sendVersionAgain) return log.er(cb, "Couldn't send tarball")(er)
+ if (er) return log.er(cb, "Couldn't send tarball")(er)
PUT(dataURI, data, log.er(cb, "Error sending version data"))
})
})