Skip to content

Commit

Permalink
improve
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel3108 committed Nov 11, 2024
1 parent 859425c commit 424966d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/cli/commands/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ export const create = new Command('create')
.option('--no-install', 'skip installing dependencies')
.configureHelp(common.helpConfig)
.action((projectPath, opts) => {
const userProvidedPath = !!projectPath;
const customPathProvided = !!projectPath;
const cwd = v.parse(ProjectPathSchema, projectPath) ?? process.cwd();
const options = v.parse(OptionsSchema, opts);
common.runCommand(async () => {
const { directory, addOnNextSteps, packageManager } = await createProject(
cwd,
options,
userProvidedPath
customPathProvided
);
const highlight = (str: string) => pc.bold(pc.cyan(str));

Expand Down Expand Up @@ -90,12 +90,12 @@ export const create = new Command('create')
});
});

async function createProject(cwd: string, options: Options, userProvidedPath: boolean) {
async function createProject(cwd: string, options: Options, customPathProvided: boolean) {
const { directory, template, language } = await p.group(
{
directory: () => {
const relativePath = path.relative(process.cwd(), cwd);
if (relativePath || userProvidedPath) return Promise.resolve(relativePath);
if (relativePath || customPathProvided) return Promise.resolve(relativePath);
const defaultPath = './';
return p.text({
message: 'Where would you like your project to be created?',
Expand Down

0 comments on commit 424966d

Please sign in to comment.