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

Cannot create python plugins with lower case python vs Python #274

Closed
umesh-timalsina opened this issue Oct 13, 2020 · 2 comments
Closed

Comments

@umesh-timalsina
Copy link

umesh-timalsina commented Oct 13, 2020

Environment:

webgme-cli version (webgme -v):
v2.8.4

Operating system and kernel: (cat /etc/os-release, uname -r preferred)
Linux isisdell 5.0.0-32-generic #34~18.04.2-Ubuntu SMP Thu Oct 10 10:36:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

NodeJS version (node -v):
v12.14.0

npm version (npm -v):
6.14.7

Description:
Cannot create a python plugin with lower case python.

Steps to Reproduce:

$ webgme new plugin createSystems --language=Python  # (Works)
$ webgme new plugin createSystems --language=python   # Fails

Results:

TypeError: self.currentConfig.language.toLowerCase is not a function
    at PluginGenerator.main (/home/umesh/.nvm/versions/node/v12.14.0/lib/node_modules/webgme-cli/node_modules/webgme-engine/src/plugin/coreplugins/PluginGenerator/PluginGenerator.js:92:48)
    at PluginGenerator.main (/home/umesh/.nvm/versions/node/v12.14.0/lib/node_modules/webgme-cli/src/shim/PluginGenerator.js:30:42)
    at PluginManager.new (/home/umesh/.nvm/versions/node/v12.14.0/lib/node_modules/webgme-cli/src/PluginManager.js:70:21)
    at PluginManager.ComponentManager._preprocess (/home/umesh/.nvm/versions/node/v12.14.0/lib/node_modules/webgme-cli/src/ComponentManager.js:50:5)
    at Command.<anonymous> (/home/umesh/.nvm/versions/node/v12.14.0/lib/node_modules/webgme-cli/bin/webgme-new-plugin:17:20)
    at Command.listener (/home/umesh/.nvm/versions/node/v12.14.0/lib/node_modules/webgme-cli/node_modules/commander/index.js:302:8)
    at Command.emit (events.js:210:5)
    at Command.parseArgs (/home/umesh/.nvm/versions/node/v12.14.0/lib/node_modules/webgme-cli/node_modules/commander/index.js:625:12)
    at Command.parse (/home/umesh/.nvm/versions/node/v12.14.0/lib/node_modules/webgme-cli/node_modules/commander/index.js:459:21)
    at Object.<anonymous> (/home/umesh/.nvm/versions/node/v12.14.0/lib/node_modules/webgme-cli/bin/webgme-new-plugin:41:9)
@brollb
Copy link
Contributor

brollb commented Oct 13, 2020

Hmm... This certainly should have provided a better error message. This appears to be a result of unexpected handling of validation failures in commander (weird).

I am reluctant to make the option validation case insensitive. This would make it so python could be passed to the cli but could cause issues if the plugin isn't converting the provided value to lower case (as it is in the stack trace). It's worth noting that this isn't an esoteric or overly cautious stance as it appears that even making the option passed to --language case insensitive would break the detection of "JavaScript".

That said, I would be happy to make this case insensitive if tests were added to test suites of the core plugins in webgme-engine.

@umesh-timalsina
Copy link
Author

umesh-timalsina commented Oct 13, 2020

While I agree that this will not be a major issue, a better warning/error message would certainly be helpful. Regardless, the option --language is set to true if any other language is passed and passed to the webgme-engine's PluginGenerator, which I think should not be the case.

 $ webgme new plugin myPlugin --language Java
/home/umesh/.nvm/versions/node/v12.14.0/lib/node_modules/webgme-cli/node_modules/webgme-engine/src/plugin/coreplugins/PluginGenerator/PluginGenerator.js:92
TypeError: self.currentConfig.language.toLowerCase is not a function

@brollb brollb closed this as completed in 92fe997 Oct 13, 2020
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

No branches or pull requests

2 participants