From ba306086c1e38074de6f9d48c0c001a5abc7ccf6 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Tue, 19 Sep 2023 12:36:02 -0400 Subject: [PATCH] Fix build on macOS (Bash 3.2) --- updateAssemblyInfo.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/updateAssemblyInfo.sh b/updateAssemblyInfo.sh index abbcfac6c9..7308e08c6f 100755 --- a/updateAssemblyInfo.sh +++ b/updateAssemblyInfo.sh @@ -11,15 +11,15 @@ dateTimeStamp=$(echo $((10#${date:0:2}-19)))${date:2} commitSha=$(git rev-parse HEAD) -assemblyVersion=$(sed -n 's/.*\([^<]*\)<.*/\1/p' $PWD/buildConfiguration.xml) -assemblyFileVersion="$assemblyVersion.${dateTimeStamp::-6}" # Trim minutes/seconds +assemblyVersion=$(sed -n 's/.*\([^<]*\)<.*/\1/p' ${scriptroot}/buildConfiguration.xml) +assemblyFileVersion="$assemblyVersion.${dateTimeStamp::$((${#dateTimeStamp} - 6))}" # Trim minutes/seconds assemblyInformationalVersion="$assemblyVersion.$dateTimeStamp.$commitSha" echo "assemblyVersion: $assemblyVersion" echo "assemblyFileVersion: $assemblyFileVersion" echo "assemblyInformationalVersion: $assemblyInformationalVersion" -nugetSuffix=$(sed -n 's/.*\([^<]*\)<.*/\1/p' $PWD/buildConfiguration.xml) +nugetSuffix=$(sed -n 's/.*\([^<]*\)<.*/\1/p' ${scriptroot}/buildConfiguration.xml) if [ "$packageType" = "release" ] then versionSuffix="" @@ -29,17 +29,17 @@ fi echo "nugetSuffix: $nugetSuffix" -versionPath="$PWD/build/version.props" +versionPath="${scriptroot}/build/version.props" version=$(cat $versionPath) version=$(echo "$version" | sed "s|.*|$assemblyVersion|") version=$(echo "$version" | sed "s|.*|$versionSuffix|") echo "$version" > $versionPath -projects=$(sed -n '//,/<\/src>/p' $PWD/buildConfiguration.xml | sed -n 's/.*name="\([^"]*\)".*/\1/p') +projects=$(sed -n '//,/<\/src>/p' ${scriptroot}/buildConfiguration.xml | sed -n 's/.*name="\([^"]*\)".*/\1/p') for project in $projects; do name="$project" - assemblyInfoPath="$PWD/src/$name/Properties/AssemblyInfo.cs" + assemblyInfoPath="${scriptroot}/src/$name/Properties/AssemblyInfo.cs" echo "assemblyInfoPath: $assemblyInfoPath" assemblyInfo=$(cat $assemblyInfoPath)