Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jpnelson/ci-npm-publish
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: hjagodzinski/ops-ci-npm-publish
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 8 commits
  • 2 files changed
  • 2 contributors

Commits on Jul 14, 2015

  1. Merge pull request #2 from cyberdash/master

    Add support for scoped packages
    jbaxleyiii committed Jul 14, 2015
    Copy the full SHA
    3d41c09 View commit details
  2. 1.2.2

    jbaxleyiii committed Jul 14, 2015
    Copy the full SHA
    52e8fc5 View commit details

Commits on Aug 5, 2015

  1. Copy the full SHA
    e9e269e View commit details
  2. be conistent in naming conventions

    jbaxleyiii committed Aug 5, 2015
    Copy the full SHA
    e2a7f6e View commit details

Commits on Aug 17, 2015

  1. Merge pull request #4 from NewSpring/specify-registry

    Specify registry
    jbaxleyiii committed Aug 17, 2015
    Copy the full SHA
    3d8cbf4 View commit details
  2. 1.2.3

    James Baxley committed Aug 17, 2015
    Copy the full SHA
    f86fe1a View commit details

Commits on Jun 10, 2016

  1. Passing body as raw bytes

    Hubert Jagodzinski committed Jun 10, 2016
    Copy the full SHA
    a14ff67 View commit details
  2. Removed version checking

    Hubert Jagodzinski committed Jun 10, 2016
    Copy the full SHA
    9975b9d View commit details
Showing with 4 additions and 35 deletions.
  1. +3 −34 index.js
  2. +1 −1 package.json
37 changes: 3 additions & 34 deletions index.js
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ var Path = require("path"),
client = new RegClient(),

// local vars
uri = "https://registry.npmjs.org/",
uri = Flags.npmregistry || process.env.NPMREGISTRY || "https://registry.npmjs.org/",
user = Flags.npmuser || Flags.NPMUSER || process.env.NPMUSER,
password = Flags.npmpassword || Flags.NPMPASSWORD || process.env.NPMPASSWORD,
email = Flags.npmemail || Flags.NPMEMAIL || process.env.NPMEMAIL,
@@ -50,7 +50,7 @@ var publish = function() {
console.log(err);
throw err
}
var body = Fs.createReadStream(bodyPath, "base64");
var body = Fs.createReadStream(bodyPath);
// authenticated or created, ready to publish
if (data.ok) {
publishParams = {
@@ -84,38 +84,7 @@ var pkgeUp = function(){
return
}

/*
Get tags and compare versions
*/
var distTagsParams = {
package: configJSON.name
}

distTagsParams = _.extend(distTagsParams, opts)
client.distTags.fetch(uri, distTagsParams, function(err, tags){
if (err) {
console.log(err);
throw err;
}


// set versions
var currentVersion = configJSON.version,
availableVersion = tags.latest;

// see if this version is newer than npm
if (Semver.gt(currentVersion, availableVersion)) {
publish();
} else {
console.log('Exiting since ' + currentVersion + ' is lower than ' + availableVersion);
process.exit(0);
return
}


})
publish()
}


2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ci-npm-publish",
"version": "1.2.1",
"version": "1.2.3",
"description": "auto publish to npm from your ci",
"main": "index.js",
"repository": {