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

Make the --force a real flag #691

Merged
merged 1 commit into from
Aug 31, 2018
Merged

Make the --force a real flag #691

merged 1 commit into from
Aug 31, 2018

Conversation

AtomicVar
Copy link
Contributor

Make the "--force" a real flag that does not require anything after it. Fix #690

The old code:

if (!args.force && helpers.model.modelFileExists(modelPath)) {

make the sequelize ... --force useless because args.force is a '' which yields !args.force to be true. And the system will ask the user to add --force again. That's what I encountered in #690.

In a nutshell, we need to add something after the --force to make it work in this old situation.

Now it is:

if (args.force === undefined && helpers.model.modelFileExists(modelPath)) {

so when the user adds --force, the args.force is not undefined, so everything is OK.

Test

I compiled it and run npm test and it passed.

Make the "--force" a real flag that does not require anything after it. Fix #690
@sushantdhiman sushantdhiman merged commit 08c48bc into sequelize:master Aug 31, 2018
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.

None yet

2 participants