-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix command path in upgrade/index.js for windows users #6167
Conversation
generators/upgrade/index.js
Outdated
@@ -79,7 +79,8 @@ module.exports = UpgradeGenerator.extend({ | |||
this.log(`Regenerating application with JHipster ${version}...`); | |||
let generatorCommand = 'yo jhipster'; | |||
if (semver.gte(version, FIRST_CLI_SUPPORTED_VERSION)) { | |||
generatorCommand = this.clientPackageManager === 'yarn' ? '$(yarn bin)/jhipster' : '$(npm bin)/jhipster'; | |||
const generatorDir = this.clientPackageManager === 'yarn' ? shelljs.exec('yarn bin') : shelljs.exec('npm bin'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would turn off console output:
shelljs.exec('yarn bin', {silent: true})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also according to the doc sync exec should use stdout, though it seems to work without it.
shelljs.exec('yarn bin', {silent: true}).stdout;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes, forgot to do that, thanks.
@gmarziou thanks for review comments. Not sure if you mean you'll change the code by yourself or need my follow-up. Guess you guys are busy so anyway I did the change to save your time. |
generators/upgrade/index.js
Outdated
@@ -79,7 +79,8 @@ module.exports = UpgradeGenerator.extend({ | |||
this.log(`Regenerating application with JHipster ${version}...`); | |||
let generatorCommand = 'yo jhipster'; | |||
if (semver.gte(version, FIRST_CLI_SUPPORTED_VERSION)) { | |||
generatorCommand = this.clientPackageManager === 'yarn' ? '$(yarn bin)/jhipster' : '$(npm bin)/jhipster'; | |||
const generatorDir = this.clientPackageManager === 'yarn' ? shelljs.exec('yarn bin', { silent: true }).stdout : shelljs.exec('npm bin', { silent: true }).stdout; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change { silent: true }
to { silent: this.silent }
so that the --verbose
flag will print the result of the command (this is how the rest of the shelljs commands in this file are set up)
Fix #6161