|
@@ -27,13 +27,13 @@
|
|
|
|
|
|
|
|
const fileUrl = require("file-url");
|
|
const fileUrl = require("file-url");
|
|
|
const fs = require("fs");
|
|
const fs = require("fs");
|
|
|
|
|
+const api = require("./single-file-cli-api");
|
|
|
run(require("./args"))
|
|
run(require("./args"))
|
|
|
.catch(error => console.error(error.message || error)); // eslint-disable-line no-console
|
|
.catch(error => console.error(error.message || error)); // eslint-disable-line no-console
|
|
|
|
|
|
|
|
async function run(options) {
|
|
async function run(options) {
|
|
|
- const singlefile = await require("./single-file-cli-api").initialize(options);
|
|
|
|
|
let urls;
|
|
let urls;
|
|
|
- if (options.url && !singlefile.VALID_URL_TEST.test(options.url)) {
|
|
|
|
|
|
|
+ if (options.url && !api.VALID_URL_TEST.test(options.url)) {
|
|
|
options.url = fileUrl(options.url);
|
|
options.url = fileUrl(options.url);
|
|
|
}
|
|
}
|
|
|
if (options.urlsFile) {
|
|
if (options.urlsFile) {
|
|
@@ -50,6 +50,7 @@ async function run(options) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
options.retrieveLinks = true;
|
|
options.retrieveLinks = true;
|
|
|
|
|
+ const singlefile = await api.initialize(options);
|
|
|
await singlefile.capture(urls);
|
|
await singlefile.capture(urls);
|
|
|
await singlefile.finish();
|
|
await singlefile.finish();
|
|
|
}
|
|
}
|