style: adhere to standard style
This commit is contained in:
parent
f32a8e7d03
commit
d5a8cb1935
@ -4,7 +4,7 @@ var efh = require('error-first-handler')
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
efh: efh,
|
efh: efh,
|
||||||
standard: efh(function(err) {
|
standard: efh(function (err) {
|
||||||
console.log('Something went wrong:')
|
console.log('Something went wrong:')
|
||||||
if (typeof err === 'string') return console.log(err)
|
if (typeof err === 'string') return console.log(err)
|
||||||
if (err instanceof Error) return console.log(err.message)
|
if (err instanceof Error) return console.log(err.message)
|
||||||
|
@ -28,10 +28,7 @@ module.exports = function () {
|
|||||||
var config = ini.decode(fs.readFileSync('./.git/config') + '')
|
var config = ini.decode(fs.readFileSync('./.git/config') + '')
|
||||||
var repo = config['remote "origin"'].url
|
var repo = config['remote "origin"'].url
|
||||||
|
|
||||||
if (repo) pkg.repository = {
|
if (repo) pkg.repository = { type: 'git', url: ghUrl(repo) }
|
||||||
type: 'git',
|
|
||||||
url: ghUrl(repo)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// set up devDependency
|
// set up devDependency
|
||||||
|
@ -23,7 +23,7 @@ module.exports = function (test, createModule) {
|
|||||||
.run(command)
|
.run(command)
|
||||||
.code(0)
|
.code(0)
|
||||||
.stdout(/> semantic-release pre\n$/m)
|
.stdout(/> semantic-release pre\n$/m)
|
||||||
.end(function(err) {
|
.end(function (err) {
|
||||||
t.is(pkg + '', fs.readFileSync(cwd + '/package.json') + '', 'package')
|
t.is(pkg + '', fs.readFileSync(cwd + '/package.json') + '', 'package')
|
||||||
t.error(err, 'nixt')
|
t.error(err, 'nixt')
|
||||||
})
|
})
|
||||||
|
@ -39,7 +39,7 @@ module.exports = function (test, createModule) {
|
|||||||
|
|
||||||
base.clone()
|
base.clone()
|
||||||
.run('npm run postpublish')
|
.run('npm run postpublish')
|
||||||
.end(function(err) {
|
.end(function (err) {
|
||||||
t.error(err, 'nixt')
|
t.error(err, 'nixt')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -50,7 +50,7 @@ module.exports = function (test, createModule) {
|
|||||||
base.clone()
|
base.clone()
|
||||||
.exec('git checkout `git rev-parse HEAD`')
|
.exec('git checkout `git rev-parse HEAD`')
|
||||||
.run('npm run postpublish')
|
.run('npm run postpublish')
|
||||||
.end(function(err) {
|
.end(function (err) {
|
||||||
t.error(err, 'nixt')
|
t.error(err, 'nixt')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -28,7 +28,7 @@ module.exports = function (test, createModule) {
|
|||||||
.run('npm run prepublish')
|
.run('npm run prepublish')
|
||||||
.code(code)
|
.code(code)
|
||||||
.stdout(/> semantic-release pre\n\nDetermining new version\n/m)
|
.stdout(/> semantic-release pre\n\nDetermining new version\n/m)
|
||||||
.end(function(err) {
|
.end(function (err) {
|
||||||
t.error(err, 'nixt')
|
t.error(err, 'nixt')
|
||||||
|
|
||||||
var pkg = JSON.parse(fs.readFileSync(cwd + '/package.json'))
|
var pkg = JSON.parse(fs.readFileSync(cwd + '/package.json'))
|
||||||
@ -38,8 +38,8 @@ module.exports = function (test, createModule) {
|
|||||||
return t.error(null, 'no publish')
|
return t.error(null, 'no publish')
|
||||||
}
|
}
|
||||||
|
|
||||||
exec('npm publish --ignore-scripts', {cwd: cwd}, function(err) {
|
exec('npm publish --ignore-scripts', {cwd: cwd}, function (err) {
|
||||||
setTimeout(function() {
|
setTimeout(function () {
|
||||||
t.error(err, 'publish')
|
t.error(err, 'publish')
|
||||||
}, 300)
|
}, 300)
|
||||||
})
|
})
|
||||||
|
@ -27,7 +27,7 @@ module.exports = function (test, createModule) {
|
|||||||
.run(command)
|
.run(command)
|
||||||
.code(1)
|
.code(1)
|
||||||
.stdout(/Everything is alright/)
|
.stdout(/Everything is alright/)
|
||||||
.end(function(err) {
|
.end(function (err) {
|
||||||
t.error(err, 'nixt')
|
t.error(err, 'nixt')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -22,7 +22,7 @@ module.exports = function (test, createModule) {
|
|||||||
.exec('git remote add origin git@github.com:user/repo.git')
|
.exec('git remote add origin git@github.com:user/repo.git')
|
||||||
.run('./node_modules/.bin/semantic-release setup')
|
.run('./node_modules/.bin/semantic-release setup')
|
||||||
.code(0)
|
.code(0)
|
||||||
.end(function(err) {
|
.end(function (err) {
|
||||||
t.error(err, 'nixt')
|
t.error(err, 'nixt')
|
||||||
|
|
||||||
var pkg = JSON.parse(readFile(join(cwd, 'package.json')))
|
var pkg = JSON.parse(readFile(join(cwd, 'package.json')))
|
||||||
|
@ -25,7 +25,7 @@ module.exports = function (test, createModule) {
|
|||||||
, 'm'
|
, 'm'
|
||||||
))
|
))
|
||||||
.code(1)
|
.code(1)
|
||||||
.end(function(err) {
|
.end(function (err) {
|
||||||
t.error(err, 'nixt')
|
t.error(err, 'nixt')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user