-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.ts
23 lines (21 loc) · 646 Bytes
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { parseArgs } from "@std/cli";
import { basename, resolve } from "@std/path";
import { readTOML, writeXML } from "@5ouma/opml-generator/libs";
import type { Lists } from "@5ouma/opml-generator/types";
const flags = parseArgs(Deno.args, {
string: ["feeds", "output"],
default: {
feeds: "./feeds.toml",
output: "./outputs",
},
});
flags.feeds = resolve(flags.feeds);
flags.output = resolve(flags.output);
try {
const feeds: Lists = await readTOML(flags.feeds);
await writeXML(feeds, flags.output);
} catch (error) {
console.error(`🚨 ${error.message}`);
Deno.exit(1);
}
console.log(`✅ ${basename(flags.feeds)}`);