forked from microsoft/playwright-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroll_driver.sh
More file actions
executable file
·37 lines (30 loc) · 950 Bytes
/
roll_driver.sh
File metadata and controls
executable file
·37 lines (30 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
set -e
set +x
trap "cd $(pwd -P)" EXIT
cd "$(dirname $0)"
if [ "$#" -ne 1 ]; then
echo ""
echo "Usage: scripts/roll_driver.sh [new version]"
echo ""
exit 1
fi
NEW_VERSION=$1
CURRENT_VERSION=$(head -1 ./DRIVER_VERSION)
if [[ "$CURRENT_VERSION" == "$NEW_VERSION" ]]; then
echo "Current version is up to date. Skipping driver download.";
else
echo $NEW_VERSION > ./DRIVER_VERSION
./download_driver.sh
fi;
./generate_api.sh
./update_readme.sh
node -e "$(cat <<EOF
let [majorVersion, minorVersion] = process.argv[1].split('-')[0].split('.').map(part => parseInt(part, 10));
minorVersion[1]--;
const previousMajorVersion = majorVersion + '.' + minorVersion + '.0';
fs.writeFileSync('../examples/pom.xml', fs.readFileSync('../examples/pom.xml', 'utf8')
.replace(/<playwright\.version>.*<\/playwright\.version>/, '<playwright\.version>' + previousMajorVersion + '</playwright\.version>')
);
EOF
)" $NEW_VERSION