Skip to content

Commit

Permalink
fix: folder name doesn't follow the project name input
Browse files Browse the repository at this point in the history
  • Loading branch information
omeraplak committed Dec 15, 2022
1 parent 3155d20 commit 03e2aaa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "superplate-cli",
"version": "1.11.5",
"version": "1.11.6",
"description": "The frontend boilerplate with superpowers",
"license": "MIT",
"repository": {
Expand Down
12 changes: 12 additions & 0 deletions src/saofile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ const saoConfig: GeneratorConfig = {
name: "name",
message: "What would you like to name your project?:",
default: appName,
validate: (name: string) => {
const appNameValidation = validate(name);

if (appNameValidation.errors) {
return false;
}

return true;
},
},
...(sourcePrompts?.prompts ?? []).map((el: ProjectPrompt) => ({
...el,
Expand Down Expand Up @@ -140,6 +149,9 @@ const saoConfig: GeneratorConfig = {
process.exit(1);
}

sao.opts.outDir = sao.answers.name;
sao.opts.appName = sao.answers.name;

const { sourcePath } = sao.opts.extras.paths;

const actionsArray = [
Expand Down

0 comments on commit 03e2aaa

Please sign in to comment.