diff --git a/package.json b/package.json index c4e62c270..5cf9bf442 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "build": "astro check && astro build", "preview": "astro preview", "astro": "astro", - "postinstall": "bun run setup.mjs", + "postinstall": "bun run setup.ts", "lunaria:build": "lunaria build", "lunaria:preview": "lunaria preview" }, diff --git a/setup.ts b/setup.ts index 1e40fe3fc..af06c1a46 100644 --- a/setup.ts +++ b/setup.ts @@ -9,6 +9,7 @@ interface GitItem { branch?: string; folder?: string; install?: boolean; + degit?: boolean; } const gits: GitItem[] = [ @@ -26,6 +27,7 @@ const gits: GitItem[] = [ repo: "tools", folder: "packages", install: false, + degit: true, }, ]; @@ -40,6 +42,10 @@ for (const git of gits) { if (git.folder) { await $`mv ${git.name}/${git.folder}/* ${git.name} && rm -rf ${git.name}/${git.folder}`; } + + if (git.degit) { + await $`find ${git.name} -name ".git" -type d -exec rm -rf {} +`; + } } const tools = (await $`ls -d tools/* | grep -v .github`.text())