m3_lightmeter/.github/scripts/increment_build_number.sh

9 lines
248 B
Bash
Raw Normal View History

2023-09-02 10:18:01 +00:00
export newVersion="$1"
if [[ -n "$newVersion" ]]; then
2023-09-02 10:20:12 +00:00
#https://stackoverflow.com/a/30214769/13167574
2023-09-02 10:18:01 +00:00
perl -i -pe 's/^(version:\s+)(\d+\.\d+\.\d+)(\+)(\d+)$/$1.$ENV{'newVersion'}.$3.($4+1)/e' pubspec.yaml
else
echo "argument error"
fi