single-file-cli 2.0.55 → 2.0.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/version.js CHANGED
@@ -1 +1 @@
1
- export const version = "2.0.54";
1
+ export const version = "2.0.57";
package/options.js CHANGED
@@ -137,6 +137,9 @@ const OPTIONS_INFO = {
137
137
  "version": { description: "Print the version number and exit.", type: "boolean" },
138
138
  "output-json": { description: "Output the result as a JSON string containing the page and network info", type: "boolean" },
139
139
  "insert-single-file-comment": { description: "Insert a comment in the HTML header with the URL of the page", type: "boolean", defaultValue: true },
140
+ "resolve-links": { description: "Resolve link URLs to absolute URLs", type: "boolean", defaultValue: true },
141
+ "settings-file": { description: "Path to a JSON file containing the settings exported from the web extension", type: "string" },
142
+ "settings-file-profile": { description: "Name of the profile to use when using --settings-file", type: "string", defaultValue: "default" },
140
143
  };
141
144
 
142
145
  const { args, exit } = Deno;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-cli",
3
- "version": "2.0.55",
3
+ "version": "2.0.57",
4
4
  "description": "SingleFile CLI",
5
5
  "author": "Gildas Lormeau",
6
6
  "engines": {
@@ -44,6 +44,15 @@ export { run };
44
44
  async function run() {
45
45
  try {
46
46
  let urls;
47
+ if (options.settingsFile) {
48
+ const settings = JSON.parse(await Deno.readTextFile(options.settingsFile));
49
+ let profileName = options.settingsProfile || "default";
50
+ if (profileName == "default" || !settings.profiles[profileName]) {
51
+ profileName = "__Default_Settings__";
52
+ }
53
+ Object.assign(options, settings.profiles[profileName]);
54
+ delete options.settingsFile;
55
+ }
47
56
  if (options.urlsFile) {
48
57
  urls = (await readTextFile(options.urlsFile)).split("\n");
49
58
  } else {