Skip to content

Commit

Permalink
minor code restructure 🚧
Browse files Browse the repository at this point in the history
Remove package-lock 🚧
  • Loading branch information
jamesgeorge007 committed Feb 2, 2019
1 parent c2eef4b commit e11b675
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 469 deletions.
26 changes: 13 additions & 13 deletions packages/create-react-app/createReactApp.js
Expand Up @@ -61,6 +61,7 @@ const errorLogFilePatterns = [
];

let projectName;
let multipleProjectNameArgs = false;
const args = process.argv.slice(2);

const program = new commander.Command(packageJson.name)
Expand All @@ -85,17 +86,7 @@ const program = new commander.Command(packageJson.name)
});

if (argsLength > 1){

console.log(
chalk.yellow(
`\n You have provided more that one argument for <project-directory>.`
)
);

console.log(
`\n Run ${chalk.cyan(`create-react-app --help`)} to see all options.`
);
process.exit(1);
multipleProjectNameArgs = true;
}
})
.option('--verbose', 'print additional logs')
Expand Down Expand Up @@ -172,8 +163,17 @@ if (program.info) {
.then(console.log);
}

if (typeof projectName === 'undefined') {
console.error('Please specify the project directory:');
if (typeof projectName === 'undefined' || multipleProjectNameArgs) {

if (multipleProjectNameArgs) {
console.log(
chalk.yellow(
`\n You have provided more that one argument for <project-directory>.`
)
);
} else {
console.error('Please specify the project directory:');
}
console.log(
` ${chalk.cyan(program.name())} ${chalk.green('<project-directory>')}`
);
Expand Down

0 comments on commit e11b675

Please sign in to comment.