deno.land / x / denote@0.2.1 / cli / denote.ts

denote.ts
View Documentation
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
import { parseCli, semverLessThan } from "./../deps.ts";import { init } from "./init.ts";import { serve } from "./serve.ts";import { register } from "./register.ts";import { unregister } from "./unregister.ts";
const NAME = "denote";const VERSION = "0.2.1";const MINIMUM_DENO_VERSION = "1.13.0";const versionInfo = `${NAME} ${VERSION}`;
const helpMsg = `${versionInfo}
A minimal profile page generator for Deno Deploy.
Subcommands: i, init <filename> Generates sample config file with given name. s, serve <filename> Runs local server with given config file. r, register <filename> Publish the page on denote.deno.dev with given config file. u, unregister Remove the page from denote.deno.dev.
Options: -v, --version Shows the version number. -h, --help Shows the help message. -d, --debug Reveals the given arguments.`.trim();
export async function main(cliArgs: string[]) { if (semverLessThan(Deno.version.deno, MINIMUM_DENO_VERSION)) { console.error("The Deno version you are using is too old."); console.error(`Please update to Deno ${MINIMUM_DENO_VERSION} or later.`); console.error("To do this run `deno upgrade`."); return 1; }
const { "_": args, debug, force, help, name, port, token, version, watch, } = parseCli( cliArgs, { boolean: [ "debug", "force", "help", "version", "watch", ], string: [ "name", "output", "port", "token", ], alias: { d: "debug", f: "force", h: "help", n: "name", p: "port", t: "token", v: "version", w: "watch", }, default: { port: "8080", }, }, );
if (version) { console.log(versionInfo); return 0; }
const [subcommand, filename] = args.map((arg) => `${arg}`);
if (subcommand === "init" || subcommand === "i") { return await init({ debug, force, help, filename, }); } if (subcommand === "serve" || subcommand === "s") { return await serve({ debug, help, port, filename, watch, }); } if (subcommand === "register" || subcommand === "r") { return await register({ debug, help, name, token, filename, }); } if (subcommand === "unregister" || subcommand === "u") { return await unregister({ debug, help, name, token, }); } if (help) { console.log(helpMsg); return 0; } console.log(helpMsg); return 1;}
if (import.meta.main) { try { Deno.exit(await main(Deno.args)); } catch (e) { console.error(e); Deno.exit(1); }}
denote
A minimal profile page generator for Deno Deploy
GitHub Repositorykawarimidoll/denote
GitHub Stars
11

Version Info

Tagged at
3 months ago