Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enabling create app in current directory #200

Merged
merged 6 commits into from
Jul 12, 2017
Merged

enabling create app in current directory #200

merged 6 commits into from
Jul 12, 2017

Conversation

prateekbh
Copy link
Member

Fixes #110
by specifying --force this will allow you to create project in current directory.

@developit just curious, the discussion emphasize upon the usage of --force?
What if we do it without this? Whats the harm with that?

@prateekbh prateekbh requested a review from developit July 7, 2017 08:10
@prateekbh prateekbh requested a review from rkostrzewski July 7, 2017 08:11
type: 'confirm',
name: 'enableForce',
message: `You are using '--force'. Do you wish to continue?`,
default: true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default should be false

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, will change it once I reach home.

Sent from my OnePlus ONEPLUS A3003 using FastHub

if (exists && !argv.force) {
throw Error('Directory already exists.');
throw Error('Cannot intialize in the current directory, please specify a different destination.');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we write messages using chalk?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sure, not a problem at all. Red color?

Sent from my OnePlus ONEPLUS A3003 using FastHub

throw Error('Directory already exists.');
if (exists && argv.force) {
const question = {
type: 'confirm',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitespace <3

@reznord reznord added this to the 1.4.0 milestone Jul 12, 2017
Copy link
Member

@reznord reznord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

if (forceInit.enableForce) {
process.stdout.write('Initializing project in the current directory...\n');
} else {
process.stdout.write(`${chalk.red('Error:')} Cannot initialize in the current directory`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be process.stderr.write. BTW why not color whole message to red?

}

if (exists && !argv.force) {
process.stdout.write(`${chalk.red('Error:')} Cannot initialize in the current directory, please specify a different destination`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be process.stderr.write

default: false,
};

let forceInit = await inquirer.prompt(question);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hint: let { enableForce } = , also enableForce:
enableForce

@reznord
Copy link
Member

reznord commented Jul 12, 2017

Let the tests run !! :P Merging this one 😄

@reznord reznord merged commit 0f235f1 into master Jul 12, 2017
@reznord reznord deleted the currDest branch July 19, 2017 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants