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

fix: command descriptions separated to avoid duplication #269

Merged
merged 1 commit into from
May 17, 2024

Conversation

karldivad
Copy link
Contributor

Summary

This PR fixes/implements the following bugs/features

Explain the motivation for making this change. What existing problem does the pull request solve?

When trying any command (e.x. emulsify init, emulsify install) it throws an error about duplicated options. Tested with Node 20.13.0.

How to review this pull request

  • Step 1 try command emulsify init.
  • Step 2 It should ask for name of the theme.
  • Step 3 Add name and rerun
  • Step 4 It should pass now, throwing an error that it didn't detected emulsify project.

Closing issues

Closes #268

@jtmitchelliv
Copy link

This still fails with previous versions of emulsify cli and node.

$ npm install -g @emulsify/[email protected]

changed 31 packages in 2s

5 packages are looking for funding
  run `npm fund` for details
$ emulsify init
/Users/johnmitchell/.nvm/versions/node/v20.13.1/lib/node_modules/@emulsify/cli/dist/node_modules/commander/lib/command.js:579
      throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}'
      ^

Error: Cannot add option '-c --checkout <commit/branch/tag>' due to conflicting flag '--checkout'
-  already used by option '-c --checkout <commit/branch/tag>'
    at Command._registerOption (/Users/johnmitchell/.nvm/versions/node/v20.13.1/lib/node_modules/@emulsify/cli/dist/node_modules/commander/lib/command.js:579:13)
    at Command.addOption (/Users/johnmitchell/.nvm/versions/node/v20.13.1/lib/node_modules/@emulsify/cli/dist/node_modules/commander/lib/command.js:616:10)
    at Command._optionEx (/Users/johnmitchell/.nvm/versions/node/v20.13.1/lib/node_modules/@emulsify/cli/dist/node_modules/commander/lib/command.js:701:17)
    at Command.option (/Users/johnmitchell/.nvm/versions/node/v20.13.1/lib/node_modules/@emulsify/cli/dist/node_modules/commander/lib/command.js:727:17)
    at Object.<anonymous> (/Users/johnmitchell/.nvm/versions/node/v20.13.1/lib/node_modules/@emulsify/cli/dist/index.js:23:6)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)

Node.js v20.13.1
$ npm install -g @emulsify/[email protected]

added 31 packages in 755ms

5 packages are looking for funding
  run `npm fund` for details
$ emulsify init
/Users/johnmitchell/.nvm/versions/node/v18.20.2/lib/node_modules/@emulsify/cli/dist/node_modules/commander/lib/command.js:579
      throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}'
      ^

Error: Cannot add option '-c --checkout <commit/branch/tag>' due to conflicting flag '--checkout'
-  already used by option '-c --checkout <commit/branch/tag>'
    at Command._registerOption (/Users/johnmitchell/.nvm/versions/node/v18.20.2/lib/node_modules/@emulsify/cli/dist/node_modules/commander/lib/command.js:579:13)
    at Command.addOption (/Users/johnmitchell/.nvm/versions/node/v18.20.2/lib/node_modules/@emulsify/cli/dist/node_modules/commander/lib/command.js:616:10)
    at Command._optionEx (/Users/johnmitchell/.nvm/versions/node/v18.20.2/lib/node_modules/@emulsify/cli/dist/node_modules/commander/lib/command.js:701:17)
    at Command.option (/Users/johnmitchell/.nvm/versions/node/v18.20.2/lib/node_modules/@emulsify/cli/dist/node_modules/commander/lib/command.js:727:17)
    at Object.<anonymous> (/Users/johnmitchell/.nvm/versions/node/v18.20.2/lib/node_modules/@emulsify/cli/dist/index.js:23:6)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)

Node.js v18.20.2

@franxo
Copy link

franxo commented May 15, 2024

Hi,
I can confirm that the fix added by @karldivad works perfect with node version 20.13
Thank you!

@mikeethedude mikeethedude added the 🎉 Passes Functional Review Functionality is approved by the reviewer. label May 17, 2024
@mikeethedude mikeethedude self-requested a review May 17, 2024 13:55
Copy link
Contributor

@mikeethedude mikeethedude left a comment

Choose a reason for hiding this comment

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

Ran through this locally and this seems to solve the problem. Thanks for getting this in there!

@mikeethedude mikeethedude added 🎉 Passes Code Review Code is approved by the reviewer. 🎉 Ready to Merge Functionality is approved by the reviewer. labels May 17, 2024
@mikeethedude
Copy link
Contributor

Confirmed this works in at least Node 18+ so this should be good to go. Thanks @karldivad !

@mikeethedude mikeethedude merged commit 02a0b85 into emulsify-ds:develop May 17, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 Passes Code Review Code is approved by the reviewer. 🎉 Passes Functional Review Functionality is approved by the reviewer. 🎉 Ready to Merge Functionality is approved by the reviewer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Emulsify init not working on 1.8.0
4 participants