Installing dependencies.

This commit is contained in:
2025-11-11 06:53:11 -05:00
parent 2c36c04da6
commit 0d2fea3c88
14371 changed files with 2770923 additions and 25 deletions
+27
View File
@@ -0,0 +1,27 @@
const path = require('path');
const {readFile, writeFile, ensureFile} = require('fs-extra');
const resolveConfig = require('./resolve-config');
module.exports = async (pluginConfig, {cwd, nextRelease: {notes}, logger}) => {
const {changelogFile, changelogTitle} = resolveConfig(pluginConfig);
const changelogPath = path.resolve(cwd, changelogFile);
if (notes) {
await ensureFile(changelogPath);
const currentFile = (await readFile(changelogPath)).toString().trim();
if (currentFile) {
logger.log('Update %s', changelogPath);
} else {
logger.log('Create %s', changelogPath);
}
const currentContent =
changelogTitle && currentFile.startsWith(changelogTitle)
? currentFile.slice(changelogTitle.length).trim()
: currentFile;
const content = `${notes.trim()}\n${currentContent ? `\n${currentContent}\n` : ''}`;
await writeFile(changelogPath, changelogTitle ? `${changelogTitle}\n\n${content}` : content);
}
};