fix(build): create cache folder if it doesn't exist

This commit is contained in:
Pihkaal
2024-09-12 16:39:19 +02:00
parent 3c82f32f9d
commit fefbe213ad

View File

@@ -1,5 +1,5 @@
import { Plugin } from "vite"; import { Plugin } from "vite";
import { readFile, writeFile } from "fs/promises"; import { mkdir, readFile, writeFile } from "fs/promises";
import { spawnSync } from "child_process"; import { spawnSync } from "child_process";
import { Octokit, RestEndpointMethodTypes } from "@octokit/rest"; import { Octokit, RestEndpointMethodTypes } from "@octokit/rest";
import { env } from "./env"; import { env } from "./env";
@@ -56,6 +56,7 @@ export const manifest = (): Plugin => ({
if (storedUpdatedAt === manifestRepo.updated_at) return; if (storedUpdatedAt === manifestRepo.updated_at) return;
} catch {} } catch {}
await mkdir("./node_modules/.cache");
await writeFile("./node_modules/.cache/assets", manifestRepo.updated_at); await writeFile("./node_modules/.cache/assets", manifestRepo.updated_at);
const getRepoFileContent = async (repo: string, path: string) => { const getRepoFileContent = async (repo: string, path: string) => {