Skip to content

Commit

Permalink
Don't fail if logs directory exists already (digital-asset#10423)
Browse files Browse the repository at this point in the history
changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
  • Loading branch information
aherrmann-da and aherrmann authored Jul 27, 2021
1 parent 7c88b56 commit fe1b642
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ if (!(Test-Path .\.bazelrc.local)) {

$ARTIFACT_DIRS = if ("$env:BUILD_ARTIFACTSTAGINGDIRECTORY") { $env:BUILD_ARTIFACTSTAGINGDIRECTORY } else { Get-Location }

mkdir -p ${ARTIFACT_DIRS}/logs
if (!(Test-Path ${ARTIFACT_DIRS}/logs)) {
mkdir -p ${ARTIFACT_DIRS}/logs
} elseif (Test-Path ${ARTIFACT_DIRS}/logs -PathType Leaf) {
throw ("Cannot create directory '${ARTIFACT_DIRS}/logs'. Conflicting file.")
}

# If a previous build was forcefully terminated, then stack's lock file might
# not have been cleaned up properly leading to errors of the form
Expand Down

0 comments on commit fe1b642

Please sign in to comment.