-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpdf.ts
39 lines (38 loc) · 1.12 KB
/
pdf.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { Command } from "commander";
import {
accessKeyOption,
branchOption,
buildIdOption,
buildNameOption,
customIdOption,
defaultBranchOption,
projectOption,
regionOption,
usernameOption,
} from "./options.js";
import { PdfCommandHandler, PdfCommandParams } from "../app/pdf-handler.js";
export const pdfCommand = () => {
return new Command()
.name("pdf")
.description("Create visual snapshots for each page of a PDF file")
.argument("<pdf-file-path>", "A path to a PDF file")
.addOption(usernameOption)
.addOption(accessKeyOption)
.addOption(regionOption)
.addOption(buildNameOption)
.addOption(branchOption)
.addOption(defaultBranchOption)
.addOption(projectOption)
.addOption(buildIdOption)
.addOption(customIdOption)
.action((pdfFilePath: string, params: PdfCommandParams) => {
new PdfCommandHandler()
.handle(pdfFilePath, params)
.then(() => {
console.log("Successfully created PDF snapshots");
})
.catch((err) => {
console.error(`An error occured when creating PDF snapshots: ${err}`);
});
});
};