webscopeio / license.sh

License checker tool - We're in a beta phase, any help is appreciated, especially reporting issues
https://webscopeio.github.io/license.sh
MIT License
40 stars 6 forks source link

Fatal error on custom config path #88

Closed jozefhruska closed 4 years ago

jozefhruska commented 4 years ago

I tried to specify custom config path by using: license-sh --config ../.license-sh.json

I got this fatal error afterwards:

===========
Initiated License.sh check for Maven project hazelcast-cloud located at .
===========
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/resources.py", line 188, in path
    yield Path(reader.resource_path(resource))
  File "/usr/local/lib/python3.7/site-packages/license_sh/runners/maven/__init__.py", line 40, in get_dependency_tree_xml
    subprocess.run(["mvn", "install", f"-f={maven_path}"], capture_output=not debug)
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 472, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1522, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'mvn': 'mvn'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/license-sh", line 2, in <module>
    from license_sh import __main__
  File "/usr/local/lib/python3.7/site-packages/license_sh/__main__.py", line 25, in <module>
    run_license_sh(arguments)
  File "/usr/local/lib/python3.7/site-packages/license_sh/commands/run_license_sh.py", line 64, in run_license_sh
    dep_tree, license_map = runner.check()
  File "/usr/local/lib/python3.7/site-packages/license_sh/runners/maven/__init__.py", line 209, in check
    xml_tree = get_dependency_tree_xml(self.directory, self.debug)
  File "/usr/local/lib/python3.7/site-packages/license_sh/runners/maven/__init__.py", line 40, in get_dependency_tree_xml
    subprocess.run(["mvn", "install", f"-f={maven_path}"], capture_output=not debug)
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py", line 161, in __exit__
    raise RuntimeError("generator didn't stop after throw()")
RuntimeError: generator didn't stop after throw()

It probably expects just a path to a directory, but I think it should handle a path to a config file too (parameter is called --config not --configFolder).