use buffer writing

This commit is contained in:
Cynthia Foxwell 2017-12-13 13:37:39 -07:00
parent 31441b6a73
commit c0237afb79
1 changed files with 2 additions and 2 deletions

View File

@ -107,9 +107,9 @@ var new_injector = function () {
//Until they remove this listener, we'll be replacing it for now, later we'll readd it.
let dirlisting = _fs.readdirSync(data());
let latestver = dirlisting.filter(d=>d.indexOf("0.0.") > -1);
let mainScreen = _fs.readFileSync(`${data()}/${latestver[latestver.length-1]}/modules/discord_desktop_core/app/mainScreen.js`);
let mainScreen = new Buffer(_fs.readFileSync(`${data()}/${latestver[latestver.length-1]}/modules/discord_desktop_core/app/mainScreen.js`));
mainScreen = mainScreen.replace(" // TODO: why do we listen to this?\n mainWindow.webContents.on('dom-ready', function () {});"," // Thank you for using Cynergy c:\n mainWindow.webContents.on('dom-ready', function () {require('${data().replace(/\\/g,"/") + '/cynergy/i.js'}').x(mainWindow)});");
mainScreen = mainScreen.write(" // Thank you for using Cynergy c:\n mainWindow.webContents.on('dom-ready', function () {require('${data().replace(/\\/g,"/") + '/cynergy/i.js'}').x(mainWindow)});", mainScreen.indexOf(" // TODO: why do we listen to this?\n mainWindow.webContents.on('dom-ready', function () {});"));
_fs.writeFileSync(`${data()}/${latestver[latestver.length-1]}/modules/discord_desktop_core/app/mainScreen.js`,mainScreen);
}