-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathindex.js
32 lines (31 loc) · 906 Bytes
/
index.js
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
var argv = require("yargs")
.usage("Sign, encrypt or decrypt UASIGN files")
.option("tsp", { default: false })
.option("tax", { default: true })
.option("edrpou", {})
.string("edrpou")
.option("detached", { default: false })
.option("role", { default: "director" }).argv;
const agent = require("./agent");
agent
.main(argv)
.then((result) => {
// daemon was started and is still running
if (typeof result === "function") {
return null;
}
process.exit(result ? 0 : 1);
})
.catch((error) => {
if(error.constructor.name === 'ENOKEY') {
console.error(error.message);
console.error("Try adding --role personal or --role stampt to you commandline");
}
else if (!(error instanceof agent.ReadFileError)) {
console.error("Internal error");
}
if (argv.debug) {
console.error("Details", error);
}
process.exit(1);
});