-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.ts
35 lines (30 loc) · 866 Bytes
/
cli.ts
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
#!/usr/bin/env node
import { program } from "commander";
import { runMigrations } from "./index";
import { version } from "./package.json";
import { MIGRATIONS_COLLECTION_NAME } from "./utils";
program.requiredOption("--migrations <path>", "Path to migrations folder");
program.option(
"--migrationsCollection <string>",
"Name of migrations collection",
MIGRATIONS_COLLECTION_NAME
);
program.option("--databaseId <string>", "Id of firestore database to use");
program.option("--tsconfig <path>", "Path to tsconfig file");
program.option("--verbose", "Enable verbose logging", false);
program.version(version);
program.parse();
const {
migrations,
databaseId,
tsconfig,
migrationsCollection: migrationsCollectionName,
verbose,
} = program.opts();
runMigrations({
migrations,
databaseId,
tsconfig,
migrationsCollectionName,
verbose,
});