Skip to content

Commit 03e2aaa

Browse files
committed
fix: folder name doesn't follow the project name input
1 parent 3155d20 commit 03e2aaa

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "superplate-cli",
3-
"version": "1.11.5",
3+
"version": "1.11.6",
44
"description": "The frontend boilerplate with superpowers",
55
"license": "MIT",
66
"repository": {

src/saofile.ts

+12
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ const saoConfig: GeneratorConfig = {
4646
name: "name",
4747
message: "What would you like to name your project?:",
4848
default: appName,
49+
validate: (name: string) => {
50+
const appNameValidation = validate(name);
51+
52+
if (appNameValidation.errors) {
53+
return false;
54+
}
55+
56+
return true;
57+
},
4958
},
5059
...(sourcePrompts?.prompts ?? []).map((el: ProjectPrompt) => ({
5160
...el,
@@ -140,6 +149,9 @@ const saoConfig: GeneratorConfig = {
140149
process.exit(1);
141150
}
142151

152+
sao.opts.outDir = sao.answers.name;
153+
sao.opts.appName = sao.answers.name;
154+
143155
const { sourcePath } = sao.opts.extras.paths;
144156

145157
const actionsArray = [

0 commit comments

Comments
 (0)