:)
This commit is contained in:
@@ -35,7 +35,8 @@ function getReadmeFileName() {
|
||||
return null;
|
||||
}
|
||||
function readReadmeFile(readmeFile) {
|
||||
let content = (0, fs_1.readFileSync)(readmeFile).toString();
|
||||
const content = (0, fs_1.readFileSync)(readmeFile).toString();
|
||||
console.log(JSON.stringify(content));
|
||||
const regex = /\n{0,1}<!-- START INSTALL LINKS -->(?:.|\n)*?<!-- END INSTALL LINKS -->\n{0,1}/;
|
||||
const index = regex.exec(content)?.index;
|
||||
let contentPre = '', contentPost = '';
|
||||
@@ -43,9 +44,9 @@ function readReadmeFile(readmeFile) {
|
||||
contentPre = content;
|
||||
}
|
||||
else {
|
||||
content = content.replace(regex, '');
|
||||
contentPre = content.slice(0, index);
|
||||
contentPost = content.slice(index);
|
||||
let content_replace = content.replace(regex, '');
|
||||
contentPre = content_replace.slice(0, index);
|
||||
contentPost = content_replace.slice(index);
|
||||
}
|
||||
if (!contentPre.endsWith('\n')) {
|
||||
contentPre += '\n';
|
||||
|
||||
Reference in New Issue
Block a user