forked from kriasoft/react-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost-install.js
More file actions
31 lines (28 loc) · 733 Bytes
/
post-install.js
File metadata and controls
31 lines (28 loc) · 733 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
/* SPDX-FileCopyrightText: 2014-present Kriasoft */
/* SPDX-License-Identifier: MIT */
import { execa } from "execa";
import fs from "node:fs";
import { EOL } from "node:os";
// Create Git-ignored files for environment variable overrides
if (!fs.existsSync("./.env.local")) {
await fs.writeFile(
"./.env.local",
[
`# Overrides for the \`.env\` file in the root folder.`,
"#",
"# CLOUDFLARE_API_TOKEN=xxxxx",
"# GOOGLE_CLOUD_CREDENTIALS=xxxxx",
"# SENDGRID_API_KEY=xxxxx",
"#",
"",
"API_URL=http://localhost:8080",
"",
].join(EOL),
"utf-8",
);
}
try {
await execa("yarn", ["tsc", "--build"], { stdin: "inherit" });
} catch (err) {
console.error(err);
}