Skip to content

Commit 73736ec

Browse files
authored
Merge pull request #276 from TheRijn/wsl-html-url
Show html path within wsl
2 parents 41406fc + 679598b commit 73736ec

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Diff for: check50/__main__.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from json import JSONDecodeError
99
import logging
1010
import os
11+
import platform
1112
import site
1213
from pathlib import Path
1314
import shutil
@@ -406,7 +407,13 @@ def main():
406407
html = renderer.to_html(**results)
407408
with tempfile.NamedTemporaryFile(mode="w", delete=False, suffix=".html") as html_file:
408409
html_file.write(html)
409-
url = f"file://{html_file.name}"
410+
411+
if "microsoft-standard" in platform.uname().release:
412+
stream = os.popen(f"wslpath -m {html_file.name}")
413+
wsl_path = stream.read().strip()
414+
url = f"file://{wsl_path}"
415+
else:
416+
url = f"file://{html_file.name}"
410417
else:
411418
url = f"https://submit.cs50.io/check50/{tag_hash}"
412419

Diff for: setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
"console_scripts": ["check50=check50.__main__:main"]
3030
},
3131
url="https://github.com/cs50/check50",
32-
version="3.3.6",
32+
version="3.3.7",
3333
include_package_data=True
3434
)

0 commit comments

Comments
 (0)