-
Notifications
You must be signed in to change notification settings - Fork 939
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update readme upon api update (#308)
- Loading branch information
1 parent
1467ee5
commit 524fc3e
Showing
3 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#!/bin/bash | ||
|
||
python scripts/update_versions.py | ||
|
||
function update_api { | ||
echo "Generating $1" | ||
file_name="$1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import re | ||
from playwright import sync_playwright | ||
|
||
with sync_playwright() as p: | ||
r = open("README.md", "r") | ||
text = r.read() | ||
for browser_type in [p.chromium, p.firefox, p.webkit]: | ||
rx = re.compile(r"<!-- GEN:" + browser_type.name + r"-version -->([^<]+)<!-- GEN:stop -->") | ||
browser = browser_type.launch() | ||
text = rx.sub(f"<!-- GEN:{browser_type.name}-version -->{browser.version}<!-- GEN:stop -->", text) | ||
browser.close() | ||
|
||
w = open("README.md", "w") | ||
w.write(text) | ||
w.close() |