File: update_api.sh

package info (click to toggle)
python-playwright 1.55.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,728 kB
  • sloc: python: 53,655; javascript: 383; sh: 216; makefile: 6
file content (24 lines) | stat: -rwxr-xr-x 594 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

function update_api {
    echo "Generating $1"
    file_name="$1"
    generate_script="$2"
    git checkout HEAD -- "$file_name"

    if PYTHONIOENCODING=utf-8 python "$generate_script" > .x; then
        mv .x "$file_name"
        pre-commit run --files $file_name
        echo "Regenerated APIs"
    else
        echo "Exited due to errors"
        exit 1
    fi
}

update_api "playwright/sync_api/_generated.py" "scripts/generate_sync_api.py"
update_api "playwright/async_api/_generated.py" "scripts/generate_async_api.py"

playwright install

python scripts/update_versions.py