File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,7 @@ DOTNET_BINARY=""
149149
150150if dotnet --version > /dev/null ; then
151151 DOTNET_BINARY=$( which dotnet)
152+ RUNTIME_VERSIONS=$( dotnet --list-runtimes | awk ' {print $2}' | sort | uniq)
152153fi
153154
154155MAJOR_VERSION_ID=$( echo $( dotnet --version) | cut -d . -f 1)
233234if [[ " ${PINNED_SDK_VERSION} " != " " ]]; then
234235 rm -f ${GIT_ORYX} /global.json
235236 rm -rf /usr/share/dotnet/sdk/$PINNED_SDK_VERSION
236-
237- # Extract the major, minor version and the first digit of the patch version
238- MAJOR_MINOR_PATCH1_VERSION=${PINNED_SDK_VERSION% ??}
239- rm -rf /usr/share/dotnet/shared/Microsoft.NETCore.App/$MAJOR_MINOR_PATCH1_VERSION
240- rm -rf /usr/share/dotnet/shared/Microsoft.AspNetCore.App/$MAJOR_MINOR_PATCH1_VERSION
241- rm -rf /usr/share/dotnet/templates/$MAJOR_MINOR_PATCH1_VERSION
237+ NEW_RUNTIME_VERSIONS=$( dotnet --list-runtimes | awk ' {print $2}' | sort | uniq)
238+ SDK_INSTALLED_RUNTIME=$( echo " $NEW_RUNTIME_VERSIONS " | grep -vxFf <( echo " $RUNTIME_VERSIONS " ) )
239+ rm -rf /usr/share/dotnet/shared/Microsoft.NETCore.App/$SDK_INSTALLED_RUNTIME
240+ rm -rf /usr/share/dotnet/shared/Microsoft.AspNetCore.App/$SDK_INSTALLED_RUNTIME
241+ rm -rf /usr/share/dotnet/templates/$SDK_INSTALLED_RUNTIME
242242fi
243243
244244
You can’t perform that action at this time.
0 commit comments