Skip to content

Commit 524fc3e

Browse files
committed
chore: update readme upon api update (microsoft#308)
1 parent 1467ee5 commit 524fc3e

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Playwright is a Python library to automate [Chromium](https://www.chromium.org/H
66

77
| | Linux | macOS | Windows |
88
| :--- | :---: | :---: | :---: |
9-
| Chromium <!-- GEN:chromium-version -->86.0.4238.0<!-- GEN:stop --> ||||
10-
| WebKit 14.0 ||||
11-
| Firefox <!-- GEN:firefox-version -->80.0b8<!-- GEN:stop --> ||||
9+
| Chromium <!-- GEN:chromium-version -->88.0.4324.0<!-- GEN:stop --> ||||
10+
| WebKit <!-- GEN:webkit-version -->14.0<!-- GEN:stop --> ||||
11+
| Firefox <!-- GEN:firefox-version -->83.0<!-- GEN:stop --> ||||
1212

1313
Headless execution is supported for all browsers on all platforms.
1414

scripts/update_api.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
python scripts/update_versions.py
4+
35
function update_api {
46
echo "Generating $1"
57
file_name="$1"

scripts/update_versions.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import re
2+
from playwright import sync_playwright
3+
4+
with sync_playwright() as p:
5+
r = open("README.md", "r")
6+
text = r.read()
7+
for browser_type in [p.chromium, p.firefox, p.webkit]:
8+
rx = re.compile(r"<!-- GEN:" + browser_type.name + r"-version -->([^<]+)<!-- GEN:stop -->")
9+
browser = browser_type.launch()
10+
text = rx.sub(f"<!-- GEN:{browser_type.name}-version -->{browser.version}<!-- GEN:stop -->", text)
11+
browser.close()
12+
13+
w = open("README.md", "w")
14+
w.write(text)
15+
w.close()

0 commit comments

Comments
 (0)