semantic-release/lib/verify-auth.js
2017-11-21 16:41:04 -05:00

12 lines
369 B
JavaScript

const SemanticReleaseError = require('@semantic-release/error');
module.exports = (options, env) => {
if (!options.githubToken) {
throw new SemanticReleaseError('No github token specified.', 'ENOGHTOKEN');
}
if (!(env.NPM_TOKEN || (env.NPM_OLD_TOKEN && env.NPM_EMAIL))) {
throw new SemanticReleaseError('No npm token specified.', 'ENONPMTOKEN');
}
};