Skip to content

Commit f13bc6e

Browse files
committed
chore: auto update example pw version in pom
1 parent 995cf90 commit f13bc6e

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

examples/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010
<name>Playwright Client Examples</name>
1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13+
<playwright-version>1.49.0</playwright-version>
1314
</properties>
1415
<dependencies>
1516
<dependency>
1617
<groupId>com.microsoft.playwright</groupId>
1718
<artifactId>playwright</artifactId>
18-
<version>1.41.0</version>
19+
<version>${playwright-version}</version>
1920
</dependency>
2021
</dependencies>
2122
<build>

scripts/set_maven_version.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ POM_FILES=(
2020
examples/pom.xml
2121
)
2222

23-
for name in ${POM_FILES[*]};
24-
do
25-
mvn versions:set -D generateBackupPoms=false -D newVersion=$VERSION -f $name
26-
done
23+
node -e "$(cat <<EOF
24+
const parts = process.argv[1].split('.').map(part => parseInt(part, 10));
25+
parts[1]--;
26+
const previousMajorVersion = parts.join('.');
27+
fs.writeFileSync('examples/pom.xml', fs.readFileSync('examples/pom.xml', 'utf8')
28+
.replace(/<playwright-version>.*<\/playwright-version>/, '<playwright-version>' + previousMajorVersion + '</playwright-version>')
29+
);
30+
EOF
31+
)" $VERSION

0 commit comments

Comments
 (0)