chore: compile, remove debug log
This commit is contained in:
Vendored
+6
-1
@@ -4,6 +4,7 @@ import path from "path";
|
|||||||
import { execSync } from "child_process";
|
import { execSync } from "child_process";
|
||||||
import { fileURLToPath } from "url";
|
import { fileURLToPath } from "url";
|
||||||
import { input, select } from "@inquirer/prompts";
|
import { input, select } from "@inquirer/prompts";
|
||||||
|
const runnerPath = process.argv0;
|
||||||
const projectTypes = [
|
const projectTypes = [
|
||||||
{
|
{
|
||||||
name: "blank",
|
name: "blank",
|
||||||
@@ -52,7 +53,11 @@ async function main() {
|
|||||||
console.error("❌ Directory already exists");
|
console.error("❌ Directory already exists");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
const buildThemeScript = path.resolve(__dirname, `../scripts/build-theme.ts`);
|
||||||
fs.cpSync(templateDir, targetDir, { recursive: true });
|
fs.cpSync(templateDir, targetDir, { recursive: true });
|
||||||
|
fs.cpSync(buildThemeScript, path.join(targetDir, "build-theme.ts"), {
|
||||||
|
recursive: true,
|
||||||
|
});
|
||||||
const pkgPath = path.join(targetDir, "package.json");
|
const pkgPath = path.join(targetDir, "package.json");
|
||||||
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
||||||
pkg.name = projectName;
|
pkg.name = projectName;
|
||||||
@@ -62,7 +67,7 @@ async function main() {
|
|||||||
theme.name = projectName;
|
theme.name = projectName;
|
||||||
fs.writeFileSync(themePath, JSON.stringify(theme, null, 2));
|
fs.writeFileSync(themePath, JSON.stringify(theme, null, 2));
|
||||||
console.log("📦 Installing dependencies...");
|
console.log("📦 Installing dependencies...");
|
||||||
execSync("npm install", { cwd: targetDir, stdio: "inherit" });
|
execSync(`${runnerPath} install`, { cwd: targetDir, stdio: "inherit" });
|
||||||
console.log(`\n✅ Theme created!\n`);
|
console.log(`\n✅ Theme created!\n`);
|
||||||
}
|
}
|
||||||
main().catch((err) => {
|
main().catch((err) => {
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ import { input, select } from "@inquirer/prompts";
|
|||||||
|
|
||||||
const runnerPath = process.argv0;
|
const runnerPath = process.argv0;
|
||||||
|
|
||||||
console.log(runnerPath);
|
|
||||||
|
|
||||||
const projectTypes = [
|
const projectTypes = [
|
||||||
{
|
{
|
||||||
name: "blank",
|
name: "blank",
|
||||||
|
|||||||
Reference in New Issue
Block a user