sw360 / capycli

CaPyCLI - Python scripts for software license compliance automation with SW360
Other
13 stars 7 forks source link

'capycli bom findsources' fails with 'cannot access local variable 'ext_ref'' error. #75

Closed sachinshaji closed 2 months ago

sachinshaji commented 2 months ago

Command used

capycli bom findsources -i findsources-javascript.json -o findsources-javascript.json-out.json -gt <github token>

Error

File "/usr/local/lib/python3.11/dist-packages/capycli/main/cli.py", line 28, in main app.run(argv) File "/usr/local/lib/python3.11/dist-packages/capycli/main/application.py", line 159, in run self._run(argv) File "/usr/local/lib/python3.11/dist-packages/capycli/main/application.py", line 140, in _run handle_bom.run_bom_command(self.options) File "/usr/local/lib/python3.11/dist-packages/capycli/bom/handle_bom.py", line 125, in run_bom_command app12.run(args) File "/usr/local/lib/python3.11/dist-packages/capycli/bom/findsources.py", line 647, in run found_count, exist_count = self.find_sources(sbom) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/capycli/bom/findsources.py", line 511, in find_sources source_url = self.find_source_url_by_language(component) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/capycli/bom/findsources.py", line 471, in find_source_url_by_language capycli.dependencies.javascript.GetJavascriptDependencies().try_find_component_metadata(component, "") File "/usr/local/lib/python3.11/dist-packages/capycli/dependencies/javascript.py", line 253, in try_find_component_metadata hash = info.get("dist", "").get("integrity", "") ^^^^ UnboundLocalError: cannot access local variable 'ext_ref' where it is not associated with a value

Attaching findsources-javascript.json

findsources-javascript.json