Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: automation/publish.js

Issue 29901591: Issue 7020 - publish gecko with Node.js (Closed) Base URL: https://gitlab.com/eyeo/adblockplus/adblockpluschrome/tree/6323e74d580026e3bd1e8e631fcddaf0bbaa34df
Patch Set: Created Oct. 16, 2018, 8:41 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « automation/.eslintrc.json ('k') | automation/target/gecko.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: automation/publish.js
diff --git a/options.js b/automation/publish.js
similarity index 50%
copy from options.js
copy to automation/publish.js
index 9b3b21b8a5e8d63941b67ad7d4d4a21bad966f5e..45951b6ff61bf88ea878752e3707c8496e4031f3 100644
--- a/options.js
+++ b/automation/publish.js
@@ -17,20 +17,28 @@
"use strict";
-let iframe = document.getElementById("content");
+const {ArgumentParser} = require("argparse");
+const fs = require("fs");
+const path = require("path");
-iframe.onload = () =>
-{
- document.title = iframe.contentDocument.title;
-};
+let platforms = {};
-browser.runtime.sendMessage({
- type: "app.get",
- what: "application"
-},
-application =>
-{
- // Load the mobile version of the options page on Firefox for Android.
- iframe.src = iframe.getAttribute("data-src-" + application) ||
- iframe.getAttribute("data-src");
+let parser = new ArgumentParser({
+ help: "Deploy an Adblock Plus development build."
+});
+let subParser = parser.addSubparsers({
+ title: "Platforms",
+ dest: "platform_name"
});
+
+for (let file of fs.readdirSync(path.resolve("automation/target/")))
+{
+ let target = path.basename(file, ".js");
+ let platformSubParser = subParser.addParser(target, {addHelp: true});
+ let module = require(path.resolve(`automation/target/${file}`));
+ module.addArguments(platformSubParser);
+ platforms[target] = module;
+}
+
+let args = parser.parseArgs();
+platforms[args.platform_name].run(args);
« no previous file with comments | « automation/.eslintrc.json ('k') | automation/target/gecko.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld