Преглед изворни кода

refactored code

Former-commit-id: 480f7f59d3cf7b06e06e12237b217d17d7254666
Gildas пре 6 година
родитељ
комит
11e4d51517
1 измењених фајлова са 1 додато и 5 уклоњено
  1. 1 5
      cli/back-ends/common/scripts.js

+ 1 - 5
cli/back-ends/common/scripts.js

@@ -64,11 +64,7 @@ const WEB_SCRIPTS = [
 exports.get = async options => {
 	let scripts = await readFiles(INDEX_SCRIPTS);
 	const webScripts = {};
-	[
-		webScripts["/lib/hooks/content/content-hooks-web.js"],
-		webScripts["/lib/hooks/content/content-hooks-frames-web.js"],
-		webScripts["/common/ui/content/content-infobar-web.js"]
-	] = await Promise.all(WEB_SCRIPTS.map(path => readScriptFile(path)));
+	await Promise.all(WEB_SCRIPTS.map(async path => webScripts[path] = await readScriptFile(path)));
 	scripts += "this.singlefile.lib.getFileContent = filename => (" + JSON.stringify(webScripts) + ")[filename];\n";
 	scripts += await readFiles(SCRIPTS);
 	scripts += await readFiles(options.browserScripts, "");