diff --git a/scripts/open_pdf_diff.py b/scripts/open_pdf_diff.py index 8ea97bd4..33ec6e2f 100644 --- a/scripts/open_pdf_diff.py +++ b/scripts/open_pdf_diff.py @@ -10,7 +10,14 @@ file_name = os.path.basename(os.path.abspath(before_path)) after_path = os.path.join(os.path.dirname(__file__), "..", "temp", file_name) - webbrowser.get("/usr/bin/google-chrome %s").open(before_path) - webbrowser.get("/usr/bin/google-chrome %s").open(after_path) + if os.environ.get("CODESPACES") == "true": + base_url = "https://{}-8000.app.github.dev/".format( + os.environ.get("CODESPACE_NAME") + ) + print("Before:", base_url + before_path.split("PyPDFForm/")[1]) + print("After:", base_url + after_path.split("PyPDFForm/./scripts/../")[1]) + else: + webbrowser.get("/usr/bin/google-chrome %s").open(before_path) + webbrowser.get("/usr/bin/google-chrome %s").open(after_path) - print("Checking", before_path) + print("Checking", before_path) diff --git a/scripts/pdf_diffs.sh b/scripts/pdf_diffs.sh index f4c46b84..f2d9ba1d 100644 --- a/scripts/pdf_diffs.sh +++ b/scripts/pdf_diffs.sh @@ -15,5 +15,5 @@ git restore --source=HEAD --staged --worktree -- ./pdf_samples for i in "${BEFORE[@]}"; do python ./scripts/open_pdf_diff.py "$i" - read -p "Press any key to continue..." -n1 -s -r + read -p "Press any key to continue..."$'\n' -n1 -s -r done