Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16a02e523e | ||
|
|
51e7579c69 | ||
|
|
acddd5a12f | ||
|
|
f6aacd2fe0 | ||
|
|
b0bc49063b |
@@ -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
|
// 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);
|
process.exit(1);
|
||||||
});
|
});
|
||||||
|
|||||||
+3
-3
@@ -23,7 +23,7 @@
|
|||||||
"execa": "^0.8.0",
|
"execa": "^0.8.0",
|
||||||
"fs-extra": "^4.0.2",
|
"fs-extra": "^4.0.2",
|
||||||
"git-head": "^1.2.1",
|
"git-head": "^1.2.1",
|
||||||
"github": "^11.0.0",
|
"github": "^12.0.0",
|
||||||
"lodash": "^4.0.0",
|
"lodash": "^4.0.0",
|
||||||
"nerf-dart": "^1.0.0",
|
"nerf-dart": "^1.0.0",
|
||||||
"nopt": "^4.0.0",
|
"nopt": "^4.0.0",
|
||||||
@@ -36,8 +36,8 @@
|
|||||||
"semver": "^5.4.1"
|
"semver": "^5.4.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"ava": "^0.22.0",
|
"ava": "^0.23.0",
|
||||||
"codecov": "^2.3.0",
|
"codecov": "^3.0.0",
|
||||||
"commitizen": "^2.9.6",
|
"commitizen": "^2.9.6",
|
||||||
"cz-conventional-changelog": "^2.0.0",
|
"cz-conventional-changelog": "^2.0.0",
|
||||||
"eslint": "^4.7.0",
|
"eslint": "^4.7.0",
|
||||||
|
|||||||
+1
-1
@@ -75,7 +75,7 @@ module.exports = async () => {
|
|||||||
log.verbose('pre', 'Running pre-script.');
|
log.verbose('pre', 'Running pre-script.');
|
||||||
log.verbose('pre', 'Veriying conditions.');
|
log.verbose('pre', 'Veriying conditions.');
|
||||||
try {
|
try {
|
||||||
await promisify(plugins.verifyConditions)(config);
|
await plugins.verifyConditions(config);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
log[options.debug ? 'warn' : 'error']('pre', err.message);
|
log[options.debug ? 'warn' : 'error']('pre', err.message);
|
||||||
if (!options.debug) process.exit(1);
|
if (!options.debug) process.exit(1);
|
||||||
|
|||||||
+13
-12
@@ -10,20 +10,21 @@ module.exports = options => {
|
|||||||
};
|
};
|
||||||
['verifyConditions', 'verifyRelease'].forEach(plugin => {
|
['verifyConditions', 'verifyRelease'].forEach(plugin => {
|
||||||
if (!Array.isArray(options[plugin])) {
|
if (!Array.isArray(options[plugin])) {
|
||||||
plugins[plugin] = normalize(
|
plugins[plugin] = promisify(
|
||||||
options[plugin],
|
normalize(
|
||||||
plugin === 'verifyConditions' ? '@semantic-release/condition-travis' : './plugin-noop'
|
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;
|
return plugins;
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ module.exports = async config => {
|
|||||||
version: type === 'initial' ? '1.0.0' : semver.inc(lastRelease.version, type),
|
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;
|
return nextRelease;
|
||||||
};
|
};
|
||||||
|
|||||||
+3
-3
@@ -44,7 +44,7 @@ test.serial('Increase version', async t => {
|
|||||||
plugins: {
|
plugins: {
|
||||||
getLastRelease: callbackify(getLastRelease),
|
getLastRelease: callbackify(getLastRelease),
|
||||||
analyzeCommits: callbackify(analyzeCommits),
|
analyzeCommits: callbackify(analyzeCommits),
|
||||||
verifyRelease: callbackify(verifyRelease),
|
verifyRelease: verifyRelease,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ test.serial('Initial version', async t => {
|
|||||||
plugins: {
|
plugins: {
|
||||||
getLastRelease: callbackify(getLastRelease),
|
getLastRelease: callbackify(getLastRelease),
|
||||||
analyzeCommits: callbackify(analyzeCommits),
|
analyzeCommits: callbackify(analyzeCommits),
|
||||||
verifyRelease: callbackify(verifyRelease),
|
verifyRelease: verifyRelease,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -137,7 +137,7 @@ test.serial('Throws error if verifyRelease fails', async t => {
|
|||||||
plugins: {
|
plugins: {
|
||||||
getLastRelease: callbackify(getLastRelease),
|
getLastRelease: callbackify(getLastRelease),
|
||||||
analyzeCommits: callbackify(analyzeCommits),
|
analyzeCommits: callbackify(analyzeCommits),
|
||||||
verifyRelease: callbackify(verifyRelease),
|
verifyRelease: verifyRelease,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user