Skip to content

Commit

Permalink
Merge pull request #635 from chinapandaman/PPF-634
Browse files Browse the repository at this point in the history
PPF-634: modify pdf diff scripts for codespaces
  • Loading branch information
chinapandaman authored May 27, 2024
2 parents 5a4984f + c133dd5 commit 2e5f722
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions scripts/open_pdf_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion scripts/pdf_diffs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2e5f722

Please sign in to comment.