FEAT: Configurable readme committer
This commit is contained in:
parent
e23fcdde1a
commit
b1facb1cba
|
@ -84,12 +84,12 @@ export async function changeCommitAuthors(recipient: Recipient, out: string = __
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function insertToReadme(projectName: string, projectLink: string, out: string = __dirname): Promise<void> {
|
export async function insertToReadme(projectName: string, projectLink: string, out: string = __dirname): Promise<void> {
|
||||||
const git = Git(out).addConfig('user.email', 'BradBot_1@outlook.com').addConfig('user.name', 'BradBot1');
|
const git = Git(out).addConfig('user.email', process.env['README_EMAIL']||"donotreply@bb1.fun").addConfig('user.name', process.env['README_NAME']||"GiteaForwarder");
|
||||||
var data: string = `> This was cloned from [${projectName}](${projectLink})\n`;
|
var data: string = `> This was cloned from [${projectName}](${projectLink})\n`;
|
||||||
if (existsSync(out + "README.md")) data = data + readFileSync(out + "README.md").toString();
|
if (existsSync(out + "README.md")) data = data + readFileSync(out + "README.md").toString();
|
||||||
writeFileSync(out + "README.md", data);
|
writeFileSync(out + "README.md", data);
|
||||||
await git.add("README.md")
|
await git.add("README.md")
|
||||||
await git.commit("Modify README.md", "README.md", {
|
await git.commit("Modify README.md", "README.md", {
|
||||||
"--author": '"BradBot1 <BradBot_1@outlook.com>"'
|
"--author": `"${process.env['README_NAME']||"GiteaForwarder"} <${process.env['README_EMAIL']||"donotreply@bb1.fun"}>"`
|
||||||
});
|
});
|
||||||
}
|
}
|
Loading…
Reference in a new issue