File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
scripts/west_commands/sbom Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 1111import json
1212import os
1313import re
14+ import shutil
1415from tempfile import NamedTemporaryFile
1516
1617from args import args
2324def check_scancode ():
2425 '''Checks if "scancode --version" works correctly. If not, raises exception with information
2526 for user.'''
27+ if shutil .which (args .scancode ) is None :
28+ raise SbomException (f'Cannot find scancode executable "{ args .scancode } ".\n '
29+ 'Install the SBOM requirements with:\n '
30+ ' pip3 install -r scripts/requirements-west-ncs-sbom.txt\n '
31+ 'Use --force-reinstall --no-cache-dir options if it still fails\n '
32+ 'Pass "--scancode=/path/to/scancode" if the scancode executable is'
33+ 'not available on PATH.' )
34+
2635 try :
2736 command_execute (args .scancode , '--version' , allow_stderr = True )
2837 except Exception as ex :
You can’t perform that action at this time.
0 commit comments