-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost-install.ts
More file actions
31 lines (28 loc) · 782 Bytes
/
post-install.ts
File metadata and controls
31 lines (28 loc) · 782 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 { existsSync } from "node:fs";
import { writeFile } from "node:fs/promises";
import { EOL } from "node:os";
// Create Git-ignored files for environment variable overrides
if (!existsSync("./.env.local")) {
await writeFile(
"./.env.local",
[
`# Overrides for the \`.env\` file in the root folder.`,
"#",
"# CLOUDFLARE_API_TOKEN=xxxxx",
"#",
"",
"API_URL=http://localhost:8080",
"",
].join(EOL),
"utf-8",
);
}
try {
await execa("bun", ["run", "tsc", "--build"], { stdin: "inherit" });
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (err) {
// console.error(err);
}