-
Notifications
You must be signed in to change notification settings - Fork 0
/
manual.js
executable file
·49 lines (45 loc) · 1.21 KB
/
manual.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env node
import { manualHandler } from "../src/handlers/manualHandler.js";
import { parseArgs } from "node:util";
import * as fs from "fs";
import * as path from "path";
import * as utils from "./utils.js";
const args = parseArgs({
options: {
class: {
type: "string",
multiple: true,
},
registry: {
type: "string",
},
gypsum: {
type: "string",
},
dir: {
type: "string",
},
project: {
type: "string",
},
asset: {
type: "string",
},
version: {
type: "string",
},
}
});
const db_paths = utils.parseConfigurations(utils.required(args, "class"), utils.required(args, "dir"));
const { list_projects, list_assets, list_versions, find_latest, read_summary, read_metadata } = utils.chooseSourceFunctions(utils.optional(args, "registry"), utils.optional(args, "gypsum"));
await manualHandler(
db_paths,
utils.required(args, "project"),
utils.optional(args, "asset"),
utils.optional(args, "version"),
list_assets,
list_versions,
find_latest,
read_summary,
read_metadata,
);