-
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathindex.ts
More file actions
37 lines (32 loc) · 891 Bytes
/
index.ts
File metadata and controls
37 lines (32 loc) · 891 Bytes
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
#!/usr/bin/env node
import cli from "./bin";
import chalk from "chalk";
export type { GridaConfig } from "./config";
import dotenv from "dotenv";
import path from "path";
// process
// .on("SIGINT", () => {
// process.exit(0); // now the "exit" event will fire
// })
// .on("uncaughtException", (err) => {
// console.log(chalk.bgRed(err.message ?? err));
// process.exit(1);
// })
// .on("unhandledRejection", (err: Error, p) => {
// console.error(chalk.bgRed(err.message ?? err));
// process.exit(1);
// });
// if main
if (require.main === module) {
// load env for accessing grida services
dotenv.config({
path: path.join(__dirname, ".public-credentials", ".env"),
});
/**
* load env for production @see {@link /cli/.runtime-env/readme.md}
*/
dotenv.config({
path: path.join(__dirname, ".runtime-env", ".env"),
});
cli();
}