Skip to content

Commit e510056

Browse files
authored
Update azure-pipelines.yml
1 parent 1d796f5 commit e510056

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

azure-pipelines.yml

+28-5
Original file line numberDiff line numberDiff line change
@@ -64,25 +64,48 @@ extends:
6464
filePath: scripts/ci/version.sh
6565
arguments: $(Build.BuildNumber)
6666
script: >
67-
#!/usr/bin/env bash # Update the version strings in the source code # Input: # $1 - the version string, if omitted, use ${BUILD_BUILDID} version=$1 if [ -z ${version} ]; then
67+
#!/usr/bin/env bash
68+
# Update the version strings in the source code
69+
# Input:
70+
# $1 - the version string, if omitted, use ${BUILD_BUILDID}
71+
version=$1
72+
73+
if [ -z ${version} ]; then
6874
version=${BUILD_BUILDID}
69-
fi if [ -z ${version} ]; then
75+
fi
76+
77+
if [ -z ${version} ]; then
7078
echo 'Missing version string'
7179
exit 1
72-
fi echo "Add dev version suffix: $version" platform=`uname` echo "Platform: $platform" pattern="s/^VERSION = [\"']\(.*\)[\"']/VERSION = \"\1.dev$version\"/" if [ "${platform}" == "MSYS_NT-10.0" ]; then
80+
fi
81+
82+
echo "Add dev version suffix: $version"
83+
84+
platform=`uname`
85+
86+
echo "Platform: $platform"
87+
88+
pattern="s/^VERSION = [\"']\(.*\)[\"']/VERSION = \"\1.dev$version\"/"
89+
90+
if [ "${platform}" == "MSYS_NT-10.0" ]; then
7391
# On preview version of sh build task, the script will pick up the wrong version of find.exe
7492
find="C:\Program Files\Git\usr\bin\find.exe"
7593
else
7694
find="find"
77-
fi for each in $("${find}" . -name setup.py); do
95+
fi
96+
97+
for each in $("${find}" . -name setup.py); do
7898
if [ "$platform" == "Darwin" ]; then
7999
sed -i "" "${pattern}" "${each}"
80100
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
81101
else
82102
sed -i "${pattern}" "${each}"
83103
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi
84104
fi
85-
done for each in $("${find}" . -name version.py); do
105+
done
106+
107+
108+
for each in $("${find}" . -name version.py); do
86109
if [ "$platform" == "Darwin" ]; then
87110
sed -i "" "${pattern}" "${each}"
88111
rc=$?; if [[ ${rc} != 0 ]]; then exit ${rc}; fi

0 commit comments

Comments
 (0)