feat: add the prepare plugin hook

BREAKING CHANGE: Committing or creating files in the `publish` plugin hook is not supported anymore and now must be done in the `prepare` hook

Plugins with a `publish` hook that makes a commit or create a file that can be committed must use the `prepare` hook.
This commit is contained in:
Pierre Vanduynslager
2018-02-19 00:28:50 -05:00
parent 20246c02b1
commit c2beb643fa
14 changed files with 104 additions and 61 deletions
-17
View File
@@ -115,22 +115,6 @@ async function push(origin, branch) {
await execa('git', ['push', '--tags', origin, `HEAD:${branch}`]);
}
/**
* Delete a tag locally and remotely.
*
* @param {String} origin The remote repository URL.
* @param {String} tagName The tag name to delete.
*/
async function deleteTag(origin, tagName) {
// Delete the local tag
let shell = await execa('git', ['tag', '-d', tagName], {reject: false});
debug('delete local tag', shell);
// Delete the tag remotely
shell = await execa('git', ['push', '--delete', origin, tagName], {reject: false});
debug('delete remote tag', shell);
}
/**
* Verify a tag name is a valid Git reference.
*
@@ -157,6 +141,5 @@ module.exports = {
verifyAuth,
tag,
push,
deleteTag,
verifyTagName,
};