Skip to content

Commit

Permalink
fix(general): fix doc links on windows (#3959)
Browse files Browse the repository at this point in the history
fix doc links on windows
  • Loading branch information
JamesWoolfenden authored Dec 1, 2022
1 parent a667f65 commit d425a84
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion checkov/common/util/docs_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ def print_checks(frameworks: Optional[List[str]] = None, use_bc_ids: bool = Fals


def get_check_link(absolute_path: str) -> str:
return f'{CODE_LINK_BASE}{absolute_path.split("/checkov")[1]}'
# this will do nothing unless it's a windows path
absolute_path = absolute_path.replace('\\', '/')
temp = absolute_path.split("checkov")
# this will even work in the likely event that you're running checkov from a folder called checkov
link = f'{CODE_LINK_BASE}{temp[len(temp)-1]}'
return link


def get_checks(frameworks: Optional[List[str]] = None, use_bc_ids: bool = False,
Expand Down

0 comments on commit d425a84

Please sign in to comment.