You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-27 23:28:38 +02:00
Doc: Added contributors
This commit is contained in:
@ -151,4 +151,13 @@ toolUtils.isMac = () => {
|
||||
return process && process.platform === 'darwin';
|
||||
}
|
||||
|
||||
toolUtils.insertContentIntoFile = async function (filePath, markerOpen, markerClose, contentToInsert) {
|
||||
const fs = require('fs-extra');
|
||||
let content = await fs.readFile(filePath, 'utf-8');
|
||||
// [^]* matches any character including new lines
|
||||
const regex = new RegExp(markerOpen + '[^]*?' + markerClose);
|
||||
content = content.replace(regex, markerOpen + contentToInsert + markerClose);
|
||||
await fs.writeFile(filePath, content);
|
||||
}
|
||||
|
||||
module.exports = toolUtils;
|
Reference in New Issue
Block a user