0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-30 22:34:10 -05:00

a few bugfixes

This commit is contained in:
Alex Kocharin 2013-12-29 04:58:48 +04:00
parent 6075034521
commit 3c7ae2f37d
2 changed files with 6 additions and 5 deletions

View file

@ -244,7 +244,8 @@ module.exports = function(config_hash) {
} }
function after_change(err, ok_message) { function after_change(err, ok_message) {
if (metadata._attachments == null && metadata.versions == null) { // old npm behaviour
if (metadata._attachments == null) {
if (err) return next(err) if (err) return next(err)
res.status(201) res.status(201)
return res.send({ return res.send({
@ -279,7 +280,7 @@ module.exports = function(config_hash) {
var t2 = Object.keys(metadata.versions)[0] var t2 = Object.keys(metadata.versions)[0]
create_version(t2, metadata.versions[t2], function(err) { create_version(t2, metadata.versions[t2], function(err) {
if (err) return err if (err) return err
res.status(201) res.status(201)
return res.send({ return res.send({
ok: ok_message ok: ok_message

View file

@ -169,7 +169,7 @@ Storage.prototype.update_versions = function(name, newdata, callback) {
} }
} }
for (var up in newdata._uplinks) { for (var up in newdata._uplinks) {
var need_change = var need_change =
!utils.is_object(data._uplinks[up]) || (newdata._uplinks[up].etag !== data._uplinks[up].etag) !utils.is_object(data._uplinks[up]) || (newdata._uplinks[up].etag !== data._uplinks[up].etag)
if (need_change) { if (need_change) {
@ -220,7 +220,7 @@ Storage.prototype.add_version = function(name, version, metadata, tag, callback)
} }
data.versions[version] = metadata data.versions[version] = metadata
utils.add_tag(data, version, tag) utils.tag_version(data, version, tag)
cb() cb()
}, callback) }, callback)
} }
@ -235,7 +235,7 @@ Storage.prototype.add_tag = function(name, version, tag, callback) {
})) }))
} }
utils.add_tag(data, version, tag) utils.tag_version(data, version, tag)
cb() cb()
}, callback) }, callback)
} }