strings are so fun :|
This commit is contained in:
@@ -7,13 +7,11 @@ function updateReadmeFile(fileList) {
|
||||
if (readmeFile !== null) {
|
||||
let [readmeStart, readmeEnd] = readReadmeFile(readmeFile);
|
||||
let installLinks = fileList.map(readmeDataToString).join('\n');
|
||||
let installLinksAll = `
|
||||
<!-- START INSTALL LINKS -->
|
||||
let installLinksAll = `<!-- START INSTALL LINKS -->
|
||||
## Installs
|
||||
|
||||
${installLinks}
|
||||
<!-- END INSTALL LINKS -->
|
||||
`;
|
||||
<!-- END INSTALL LINKS -->`;
|
||||
console.log(JSON.stringify(installLinksAll));
|
||||
let content = readmeStart + installLinksAll + readmeEnd;
|
||||
(0, fs_1.writeFileSync)(readmeFile, content);
|
||||
@@ -49,9 +47,15 @@ function readReadmeFile(readmeFile) {
|
||||
contentPost = content_replace.slice(index);
|
||||
}
|
||||
if (!contentPre.endsWith('\n')) {
|
||||
if (!contentPre.endsWith('\n\n')) {
|
||||
contentPre += '\n';
|
||||
}
|
||||
contentPre += '\n';
|
||||
}
|
||||
if (!contentPost.endsWith('\n')) {
|
||||
if (!contentPost.startsWith('\n')) {
|
||||
if (!contentPost.startsWith('\n\n')) {
|
||||
contentPre += '\n';
|
||||
}
|
||||
contentPost += '\n';
|
||||
}
|
||||
console.log(JSON.stringify(index), JSON.stringify(content), JSON.stringify(contentPre), JSON.stringify(contentPost));
|
||||
|
||||
Reference in New Issue
Block a user