Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
No need to check for a readme, read-package-json does that now.
  • Loading branch information
isaacs committed Aug 7, 2012
1 parent a7ceabd commit 9cb4f73
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions lib/publish.js
Expand Up @@ -81,24 +81,18 @@ function publish_ (arg, data, isRetry, cachedir, cb) {

function regPublish (data, isRetry, arg, cachedir, cb) {
// check to see if there's a README.md in there.
var readme = path.resolve(cachedir, "README.md")
, tarball = cachedir + ".tgz"

fs.readFile(readme, function (er, readme) {
// ignore error. it's an optional feature

registry.publish(data, tarball, readme, function (er) {
if (er && er.code === "EPUBLISHCONFLICT"
&& npm.config.get("force") && !isRetry) {
log.warn("publish", "Forced publish over "+data._id)
return npm.commands.unpublish([data._id], function (er) {
// ignore errors. Use the force. Reach out with your feelings.
publish([arg], true, cb)
})
}
if (er) return cb(er)
console.log("+ " + data._id)
cb()
})
var tarball = cachedir + ".tgz"
registry.publish(data, tarball, data.readme, function (er) {
if (er && er.code === "EPUBLISHCONFLICT"
&& npm.config.get("force") && !isRetry) {
log.warn("publish", "Forced publish over "+data._id)
return npm.commands.unpublish([data._id], function (er) {
// ignore errors. Use the force. Reach out with your feelings.
publish([arg], true, cb)
})
}
if (er) return cb(er)
console.log("+ " + data._id)
cb()
})
}

0 comments on commit 9cb4f73

Please sign in to comment.