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

Corrects scenario where no src_dir is set -5.x #247

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

cerrussell
Copy link
Collaborator

Trying to get the src_dir from the bom path is good, but we need to still set src_dir to the current working directory if depscan hasn't been run using the --bom argument (or when the bom does not actually exist). Otherwise, we will run into problems as we later assume src_dir has been set and try to use it, which will result in an exception.

    if not src_dir or src_dir == ".":
        if src_dir == "." or args.search_purl:
            src_dir = os.getcwd()
        # Try to infer from the bom file
        elif args.bom and os.path.exists(args.bom):
            src_dir = os.path.dirname(os.path.realpath(args.bom))

This PR corrects the problem.

@cerrussell cerrussell changed the title Corrects scenario where no src_dir is set. Corrects scenario where no src_dir is set -5.x Feb 13, 2024
@prabhu
Copy link
Member

prabhu commented Feb 13, 2024

@cerrussell, please rebase from release/5.x to get the CI fixes

Signed-off-by: Caroline Russell <caroline@appthreat.dev>
@cerrussell cerrussell merged commit 0447cc0 into release/5.x Feb 13, 2024
54 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants