Skip to content

Commit

Permalink
Update urlcheck.py
Browse files Browse the repository at this point in the history
Print only JSON to stdout to avoid parse error
  • Loading branch information
cordt-sei authored Aug 8, 2024
1 parent aaf3c94 commit 2f917bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/urlcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ def generate_report(report):
"total_issues": len(report),
"issues": report
}
return json.dumps(output)
print(json.dumps(output))

if __name__ == "__main__":
check_path = os.environ.get('CHECK_PATH', './pages/')
print(f"Checking URLs in location: {check_path}")
print(f"Checking URLs in location: {check_path}", file=sys.stderr) # print to stderr
report = check_location(check_path)
output = generate_report(report)
print(output)
print(output) # only print JSON to stdout

0 comments on commit 2f917bd

Please sign in to comment.