leon icon indicating copy to clipboard operation
leon copied to clipboard

Check missing config.json

Open facorazza opened this issue 6 years ago • 3 comments

Expected Behavior

It would be ideal to have some kind of warning when starting leon that X package has no config.json file.

Actual Behavior

The package silently doesn't work.

Proposal

If possible it would be great to add some sort of check when initializing the packages. It would be even better if the check could go look inside the file and check that all modules are set.

facorazza avatar Jun 11 '19 20:06 facorazza

➡ /bin/sh -c pipenv run python bridges/python/main.py scripts/assets/query-object.json ✖ Error: Command failed: /bin/sh -c pipenv run python bridges/python/main.py scripts/assets/query-object.json Traceback (most recent call last): File "bridges/python/main.py", line 20, in main() File "bridges/python/main.py", line 17, in main return getattr(m, queryobj['module'])(queryobj['query'], queryobj['entities']) File "./packages/leon/randomnumber.py", line 10, in randomnumber return utils.output('end', 'success', randint(0, 100)) File "/home///leon/bridges/python/utils.py", line 71, in output 'options': config('options') File "/home///leon/bridges/python/utils.py", line 92, in config file = open(dirname + '/../../packages/' + queryobj['package'] + '/config/config.json', 'r', encoding = 'utf8') FileNotFoundError: [Errno 2] No such file or directory: '/home///leon/bridges/python/../../packages/leon/config/config.json'

tangyongfeng avatar Jun 15 '19 20:06 tangyongfeng

This check is not performed when npm start is run. And even if it's performed, it's not propagated through.

facorazza avatar Jun 15 '19 20:06 facorazza

ok, thank you!

tangyongfeng avatar Jun 15 '19 20:06 tangyongfeng