mirror of
https://github.com/ejwa/gitinspector.git
synced 2025-01-03 11:22:15 +01:00
Some output was missing in the JSON output.
Repository names, gitinspector version and report date were all missing from the output when JSON was selected.
This commit is contained in:
parent
87fd5b467f
commit
9b3a5b674e
1 changed files with 14 additions and 0 deletions
|
@ -105,6 +105,20 @@ def output_header(repos):
|
||||||
hide_minor_rows=_("Hide rows with minor work")))
|
hide_minor_rows=_("Hide rows with minor work")))
|
||||||
elif __selected_format__ == "json":
|
elif __selected_format__ == "json":
|
||||||
print("{\n\t\"gitinspector\": {")
|
print("{\n\t\"gitinspector\": {")
|
||||||
|
print("\t\t\"version\": \"" + version.__version__ + "\",")
|
||||||
|
|
||||||
|
if len(repos) <= 1:
|
||||||
|
print("\t\t\"repository\": \"" + repos[0].name + "\",")
|
||||||
|
else:
|
||||||
|
repos_json = "\t\t\"repositories\": [ "
|
||||||
|
|
||||||
|
for repo in repos:
|
||||||
|
repos_json += "\"" + repo.name + "\", "
|
||||||
|
|
||||||
|
print(repos_json[:-2] + " ],")
|
||||||
|
|
||||||
|
print("\t\t\"report_date\": \"" + time.strftime("%Y/%m/%d") + "\",")
|
||||||
|
|
||||||
elif __selected_format__ == "xml":
|
elif __selected_format__ == "xml":
|
||||||
print("<gitinspector>")
|
print("<gitinspector>")
|
||||||
print("\t<version>" + version.__version__ + "</version>")
|
print("\t<version>" + version.__version__ + "</version>")
|
||||||
|
|
Loading…
Reference in a new issue