Added cleanup code if install dotnet cli fails
authordseefeld <dseefeld@microsoft.com>
Thu, 26 Oct 2017 16:27:47 +0000 (16:27 +0000)
committerdseefeld <dseefeld@microsoft.com>
Thu, 26 Oct 2017 16:27:47 +0000 (16:27 +0000)
Commit migrated from https://github.com/dotnet/corefx/commit/a2764c670dcec4fcfaa027e35a9e963132e5be5d

src/libraries/init-tools.sh

index 88f7994..147fed8 100755 (executable)
@@ -129,6 +129,11 @@ if [ ! -e $__DOTNET_PATH ]; then
         fi
         cd $__DOTNET_PATH
         tar -xf $__DOTNET_PATH/dotnet.tar
+        local tarResult=$?
+        if [ $tarResult -ne 0 ]; then
+            rm -f $__DOTNET_PATH/*
+        fi
+        return $tarResult
     }
     execute installDotNetCLI >> $__init_tools_log 2>&1