delete directory entries when cutting
This commit is contained in:
parent
251dce5b56
commit
a841165c51
@ -67,6 +67,11 @@ yargs(hideBin(process.argv))
|
|||||||
throw "changelog is invalid";
|
throw "changelog is invalid";
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
config.delete_next_dir_entries = () =>
|
||||||
|
globby([
|
||||||
|
config.changelog().project.next_directory + "/*.yml",
|
||||||
|
config.changelog().project.next_directory + "/*.yaml",
|
||||||
|
]).then((files) => Promise.all(files.map(fs.remove)));
|
||||||
config.save_changelog = async (changelog) => {
|
config.save_changelog = async (changelog) => {
|
||||||
if (!changelog) changelog = await config.changelog();
|
if (!changelog) changelog = await config.changelog();
|
||||||
return fs.writeFile(config.source, yaml.stringify(changelog));
|
return fs.writeFile(config.source, yaml.stringify(changelog));
|
||||||
|
@ -62,6 +62,8 @@ const handler = async (config) => {
|
|||||||
config.consola.info("running in dry mode, not saving\n", next);
|
config.consola.info("running in dry mode, not saving\n", next);
|
||||||
} else {
|
} else {
|
||||||
await config.save_changelog(changelog);
|
await config.save_changelog(changelog);
|
||||||
|
if (changelog.project.next_directory)
|
||||||
|
await config.delete_next_dir_entries();
|
||||||
}
|
}
|
||||||
|
|
||||||
config.consola.success(`version ${next.version} is cut!`);
|
config.consola.success(`version ${next.version} is cut!`);
|
||||||
|
Loading…
Reference in New Issue
Block a user