single-file-cli 2.0.62 → 2.0.63

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.62";
1
+ export const version = "2.0.63";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-cli",
3
- "version": "2.0.62",
3
+ "version": "2.0.63",
4
4
  "description": "SingleFile CLI",
5
5
  "author": "Gildas Lormeau",
6
6
  "engines": {
@@ -247,7 +247,6 @@ async function capturePage(options) {
247
247
  let filename, content;
248
248
  options.zipScript = getZipScriptSource();
249
249
  const pageData = await backend.getPageData(options);
250
- filename = pageData.filename;
251
250
  content = pageData.content;
252
251
  if (options.outputJson) {
253
252
  if (content instanceof Uint8Array) {
@@ -263,7 +262,6 @@ async function capturePage(options) {
263
262
  pageData.doctype = undefined;
264
263
  pageData.viewport = undefined;
265
264
  pageData.comment = undefined;
266
- filename += filename.endsWith(".json") ? "" : ".json";
267
265
  content = JSON.stringify(pageData, null, 2);
268
266
  }
269
267
  if (options.output) {
@@ -275,9 +273,12 @@ async function capturePage(options) {
275
273
  console.log(content || ""); // eslint-disable-line no-console
276
274
  }
277
275
  } else {
278
- filename = await getFilename(filename, options);
276
+ filename = await getFilename(pageData.filename, options);
279
277
  }
280
- if (filename && !options.dumpContent) {
278
+ if (filename) {
279
+ if (options.outputJson) {
280
+ filename += filename.endsWith(".json") ? "" : ".json";
281
+ }
281
282
  const directoryName = await path.dirname(filename);
282
283
  if (directoryName !== ".") {
283
284
  await mkdir(directoryName, { recursive: true });