fix template dir location
This commit is contained in:
12
index.ts
12
index.ts
@@ -3,7 +3,7 @@
|
||||
import * as p from "@clack/prompts";
|
||||
import { initRenderer } from '@gregorlohaus/tdir'
|
||||
import { z } from 'zod'
|
||||
import join from "node:path";
|
||||
import path from "node:path";
|
||||
|
||||
p.intro("create-glstack");
|
||||
|
||||
@@ -35,22 +35,22 @@ const project = await p.group(
|
||||
},
|
||||
}
|
||||
);
|
||||
const createRenderer = initRenderer('./template')
|
||||
const createRenderer = initRenderer(path.join(import.meta.dir, 'template'))
|
||||
const render = createRenderer(z.object({
|
||||
project: z.object({
|
||||
name: z.string(),
|
||||
goprefix: z.string()
|
||||
})
|
||||
}))
|
||||
const destDir = join.join("./",project.name);
|
||||
const destDir = path.join("./",project.name);
|
||||
render(destDir,{project})
|
||||
// TODO: template rendering — copy/generate files into destDir
|
||||
|
||||
const s = p.spinner();
|
||||
s.start("Installing dependencies");
|
||||
await Bun.$`bun install`.cwd(join.join(destDir)).quiet();
|
||||
await Bun.$`bun install`.cwd(join.join(destDir,'packages','rpc')).quiet();
|
||||
await Bun.$`bun install`.cwd(join.join(destDir,'apps','web')).quiet();
|
||||
await Bun.$`bun install`.cwd(path.join(destDir)).quiet();
|
||||
await Bun.$`bun install`.cwd(path.join(destDir,'packages','rpc')).quiet();
|
||||
await Bun.$`bun install`.cwd(path.join(destDir,'apps','web')).quiet();
|
||||
s.stop("Dependencies installed.");
|
||||
|
||||
p.outro("You're all set!");
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"template"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "bun build ./index.ts --outdir ./dist --target node",
|
||||
"build": "bun build ./index.ts --outdir ./dist --target bun",
|
||||
"prepublishOnly": "bun run build"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
Reference in New Issue
Block a user