atmo.rsvp
1/**
2 * Publish atmo-events' generated lexicons to the specified account's PDS.
3 *
4 * Usage:
5 * LEXICON_ACCOUNT_IDENTIFIER=you.bsky.social \
6 * LEXICON_ACCOUNT_PASSWORD=xxxx-xxxx-xxxx-xxxx \
7 * pnpm publish-lexicons
8 *
9 * pnpm publish-lexicons <identifier> <app-password>
10 */
11
12import { join, dirname } from 'node:path';
13import { fileURLToPath } from 'node:url';
14import { publishLexicons } from '@atmo-dev/contrail/publish';
15
16const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
17
18async function main(): Promise<void> {
19 const identifier = process.argv[2] ?? process.env.LEXICON_ACCOUNT_IDENTIFIER;
20 const password = process.argv[3] ?? process.env.LEXICON_ACCOUNT_PASSWORD;
21
22 if (!identifier || !password) {
23 console.error(
24 'Usage: pnpm publish-lexicons <handle-or-did> <app-password>\n' +
25 ' (or set LEXICON_ACCOUNT_IDENTIFIER and LEXICON_ACCOUNT_PASSWORD env vars)\n'
26 );
27 process.exit(1);
28 }
29
30 await publishLexicons({
31 generatedDir: join(ROOT, 'lexicons-generated'),
32 identifier,
33 password
34 });
35}
36
37main().catch((err) => {
38 console.error(err);
39 process.exit(1);
40});