Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
749eb11e58 | ||
|
|
36f5555d8e | ||
|
|
d4f6ee0d6a | ||
|
|
6763a006d2 | ||
|
|
0307894914 | ||
|
|
06c464f9d8 |
@@ -1,9 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
cat .tmp/sinopia.pid | xargs kill
|
||||
|
||||
cat .tmp/ghrs.pid | xargs kill
|
||||
|
||||
cp .tmp/.npmrc ~/.npmrc
|
||||
|
||||
rm -rf .tmp
|
||||
@@ -30,7 +30,11 @@ if (~argv._.indexOf('pre')) {
|
||||
if (npmArgv['semantic-release-rerun']) process.exit(0)
|
||||
// the `prepublish` hook is also executed when the package is installed
|
||||
// in this case we abort the command and do nothing.
|
||||
if (isAbbrev(npmArgv, 'install') || isAbbrev(npmArgv, 'link')) process.exit(0)
|
||||
if (
|
||||
isAbbrev(npmArgv, 'install') ||
|
||||
isAbbrev(npmArgv, 'link') ||
|
||||
isAbbrev(npmArgv, 'pack')
|
||||
) process.exit(0)
|
||||
|
||||
if (argv.debug) console.log('This is a dry run')
|
||||
|
||||
|
||||
+19
-1
@@ -1,7 +1,23 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
npm run test:style
|
||||
|
||||
function cleanup {
|
||||
set +e
|
||||
|
||||
cp .tmp/.npmrc ~/.npmrc
|
||||
|
||||
cat .tmp/sinopia.pid | xargs kill
|
||||
|
||||
cat .tmp/ghrs.pid | xargs kill
|
||||
|
||||
rm -rf .tmp
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
[ -d ".tmp" ] && ./bin/post-test
|
||||
|
||||
mkdir -p .tmp/modules
|
||||
@@ -16,3 +32,5 @@ sleep 0.5
|
||||
cp ~/.npmrc .tmp/.npmrc
|
||||
|
||||
cp tests/.npmrc ~/.npmrc
|
||||
|
||||
npm run test:integration
|
||||
+5
-1
@@ -5,7 +5,11 @@ var git = require('conventional-changelog/lib/git')
|
||||
var efh = require('../error').efh
|
||||
|
||||
module.exports = function (from, cb) {
|
||||
git.getCommits({from: from}, efh(cb)(function (commits) {
|
||||
git.getCommits({
|
||||
log: console.log.bind(console),
|
||||
warn: console.warn.bind(console),
|
||||
from: from
|
||||
}, efh(cb)(function (commits) {
|
||||
cb(null, commits)
|
||||
}))
|
||||
}
|
||||
|
||||
+7
-7
@@ -9,7 +9,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"abbrev": "^1.0.5",
|
||||
"conventional-changelog": "0.0.11",
|
||||
"conventional-changelog": "0.0.17",
|
||||
"error-first-handler": "^1.0.1",
|
||||
"git-head": "^1.2.1",
|
||||
"github": "^0.2.3",
|
||||
@@ -18,7 +18,7 @@
|
||||
"minimist": "^1.1.0",
|
||||
"parse-github-repo-url": "^1.0.0",
|
||||
"request": "^2.53.0",
|
||||
"semver": "^4.2.0"
|
||||
"semver": "^4.3.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"github-release-fake-server": "^1.3.0",
|
||||
@@ -27,8 +27,8 @@
|
||||
"nixt": "^0.4.1",
|
||||
"sinopia": "^1.0.0",
|
||||
"standard": "^3.2.1",
|
||||
"tap-spec": "^2.2.0",
|
||||
"tape": "^3.5.0"
|
||||
"tap-spec": "^3.0.0",
|
||||
"tape": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"iojs": "^1",
|
||||
@@ -55,9 +55,9 @@
|
||||
},
|
||||
"scripts": {
|
||||
"postpublish": "./bin/semantic-release.js post",
|
||||
"posttest": "./bin/post-test",
|
||||
"prepublish": "./bin/semantic-release.js pre",
|
||||
"pretest": "./bin/pre-test",
|
||||
"test": "standard && node tests | tap-spec"
|
||||
"test:style": "standard",
|
||||
"test:integration": "node tests | tap-spec",
|
||||
"test": "./bin/test"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ var test = require('tape')
|
||||
|
||||
var createModule = require('./lib/create-module')
|
||||
|
||||
require('./scenarios/install')(test, createModule)
|
||||
require('./scenarios/ignore')(test, createModule)
|
||||
require('./scenarios/prepublish')(test, createModule)
|
||||
require('./scenarios/postpublish')(test, createModule)
|
||||
require('./scenarios/publish')(test, createModule)
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
'use strict'
|
||||
|
||||
var fs = require('fs')
|
||||
|
||||
var efh = require('error-first-handler')
|
||||
var nixt = require('nixt')
|
||||
|
||||
module.exports = function (test, createModule) {
|
||||
createModule(efh()(function (name, cwd) {
|
||||
test('ignore', function (t) {
|
||||
ignoreTest(t, 'npm install', 'not doing anything when the module is installed')
|
||||
ignoreTest(t, 'npm i', 'not doing anything when the module is installed with abbrevd command')
|
||||
ignoreTest(t, 'npm link', 'not doing anything when the module is linked')
|
||||
ignoreTest(t, 'npm lin', 'not doing anything when the module is linked with abbrevd command')
|
||||
ignoreTest(t, 'npm pack', 'not doing anything when the module is packed')
|
||||
ignoreTest(t, 'npm pa', 'not doing anything when the module is packed with abbrevd command')
|
||||
})
|
||||
|
||||
function ignoreTest (t, command, name, last) {
|
||||
t.test(name, function (t) {
|
||||
t.plan(2)
|
||||
|
||||
var pkg = fs.readFileSync(cwd + '/package.json')
|
||||
|
||||
nixt()
|
||||
.cwd(cwd)
|
||||
.run(command)
|
||||
.code(0)
|
||||
.stdout(/> semantic-release pre\n$/m)
|
||||
.end(function (err) {
|
||||
t.is(pkg + '', fs.readFileSync(cwd + '/package.json') + '', 'package')
|
||||
t.error(err, 'nixt')
|
||||
})
|
||||
})
|
||||
}
|
||||
}))
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
'use strict'
|
||||
|
||||
var fs = require('fs')
|
||||
|
||||
var efh = require('error-first-handler')
|
||||
var nixt = require('nixt')
|
||||
|
||||
module.exports = function (test, createModule) {
|
||||
createModule(efh()(function (name, cwd) {
|
||||
test('install', function (t) {
|
||||
installTest(t, 'npm install', 'not doing anything when the module is installed')
|
||||
installTest(t, 'npm i', 'not doing anything when the module is installed with abbrevd command')
|
||||
})
|
||||
|
||||
function installTest (t, command, name, last) {
|
||||
t.test(name, function (t) {
|
||||
t.plan(2)
|
||||
|
||||
var pkg = fs.readFileSync(cwd + '/package.json')
|
||||
|
||||
nixt()
|
||||
.cwd(cwd)
|
||||
.run(command)
|
||||
.code(0)
|
||||
.stdout(/> semantic-release pre\n$/m)
|
||||
.end(function (err) {
|
||||
t.is(pkg + '', fs.readFileSync(cwd + '/package.json') + '', 'package')
|
||||
t.error(err, 'nixt')
|
||||
})
|
||||
})
|
||||
}
|
||||
}))
|
||||
}
|
||||
Reference in New Issue
Block a user