Skip to content

Commit

Permalink
feat(release): added semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
FauzanKhan committed Oct 17, 2017
1 parent d6d2f28 commit d0902a0
Show file tree
Hide file tree
Showing 4 changed files with 5,441 additions and 3 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
41 changes: 41 additions & 0 deletions condition.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
'use strict'

var semver = require('semver')

function conditionNodeVersion (pluginConfig, config, callback) {
pluginConfig = pluginConfig || {}
config = config || {}

function isVerbose () {
return pluginConfig.verbose ||
pluginConfig.debug ||
config.verbose ||
config.debug
}

if (isVerbose()) {
console.log('condition plugin config', pluginConfig)
console.log('condition config environment', config.env)
console.log('condition config options', config.options)
// console.log('node version', process.versions.node)
}

function fail (message) {
return callback(new Error(message))
}

// if (typeof pluginConfig.node !== 'string') {
// return fail('Missing node version in the config')
// }

// if (!semver.satisfies(process.versions.node, pluginConfig.node)) {
// return fail('Only allowed to publish from Node ' +
// pluginConfig.node + ' not from ' + process.versions.node)
// }

console.log('ok to publish from this version of Node', pluginConfig.node)

callback(null)
}

module.exports = conditionNodeVersion
Loading

0 comments on commit d0902a0

Please sign in to comment.