Compare commits

...
5 Commits
6 changed files with 24 additions and 21 deletions
+3 -1
View File
@@ -23,6 +23,8 @@ npx is bundled with npm >= 5.4, or available via npm. More info: npm.im/npx`
}
// node 8+ from this point on
require('../src')().catch(() => {
require('../src')().catch(err => {
console.error('An error occurred while running semantic-release');
console.error(err);
process.exit(1);
});
+3 -3
View File
@@ -23,7 +23,7 @@
"execa": "^0.8.0",
"fs-extra": "^4.0.2",
"git-head": "^1.2.1",
"github": "^11.0.0",
"github": "^12.0.0",
"lodash": "^4.0.0",
"nerf-dart": "^1.0.0",
"nopt": "^4.0.0",
@@ -36,8 +36,8 @@
"semver": "^5.4.1"
},
"devDependencies": {
"ava": "^0.22.0",
"codecov": "^2.3.0",
"ava": "^0.23.0",
"codecov": "^3.0.0",
"commitizen": "^2.9.6",
"cz-conventional-changelog": "^2.0.0",
"eslint": "^4.7.0",
+1 -1
View File
@@ -75,7 +75,7 @@ module.exports = async () => {
log.verbose('pre', 'Running pre-script.');
log.verbose('pre', 'Veriying conditions.');
try {
await promisify(plugins.verifyConditions)(config);
await plugins.verifyConditions(config);
} catch (err) {
log[options.debug ? 'warn' : 'error']('pre', err.message);
if (!options.debug) process.exit(1);
+13 -12
View File
@@ -10,20 +10,21 @@ module.exports = options => {
};
['verifyConditions', 'verifyRelease'].forEach(plugin => {
if (!Array.isArray(options[plugin])) {
plugins[plugin] = normalize(
options[plugin],
plugin === 'verifyConditions' ? '@semantic-release/condition-travis' : './plugin-noop'
plugins[plugin] = promisify(
normalize(
options[plugin],
plugin === 'verifyConditions' ? '@semantic-release/condition-travis' : './plugin-noop'
)
);
return;
} else {
plugins[plugin] = async pluginOptions => {
return pSeries(
options[plugin].map(step => {
return () => promisify(normalize(step, './plugin-noop'))(pluginOptions);
})
);
};
}
plugins[plugin] = async pluginOptions => {
return pSeries(
options[plugin].map(step => {
return () => promisify(normalize(step, './plugin-noop'))(pluginOptions);
})
);
};
});
return plugins;
+1 -1
View File
@@ -17,7 +17,7 @@ module.exports = async config => {
version: type === 'initial' ? '1.0.0' : semver.inc(lastRelease.version, type),
};
await promisify(verifyRelease)(assign({commits, lastRelease, nextRelease}, config));
await verifyRelease(assign({commits, lastRelease, nextRelease}, config));
return nextRelease;
};
+3 -3
View File
@@ -44,7 +44,7 @@ test.serial('Increase version', async t => {
plugins: {
getLastRelease: callbackify(getLastRelease),
analyzeCommits: callbackify(analyzeCommits),
verifyRelease: callbackify(verifyRelease),
verifyRelease: verifyRelease,
},
});
@@ -89,7 +89,7 @@ test.serial('Initial version', async t => {
plugins: {
getLastRelease: callbackify(getLastRelease),
analyzeCommits: callbackify(analyzeCommits),
verifyRelease: callbackify(verifyRelease),
verifyRelease: verifyRelease,
},
});
@@ -137,7 +137,7 @@ test.serial('Throws error if verifyRelease fails', async t => {
plugins: {
getLastRelease: callbackify(getLastRelease),
analyzeCommits: callbackify(analyzeCommits),
verifyRelease: callbackify(verifyRelease),
verifyRelease: verifyRelease,
},
})
);