Skip to content

Commit

Permalink
Allow for the fact that there might not be a Git repository when we a…
Browse files Browse the repository at this point in the history
…re building.

Fixes k-pet-group#2417
  • Loading branch information
neilccbrown committed Nov 15, 2024
1 parent eb7a43f commit c3a9f9d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bluej/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ javafx {
}

task recordCommitID(type: Exec) {
// Make a default file in case Git fails:
doFirst {
new File("${projectDir}/lib/buildid.txt").text = "Unknown"
}
commandLine "git", "rev-parse", "--short=8", "HEAD"
// Don't fail if we don't have a Git repository (e.g. building from source zip):
ignoreExitValue true
standardOutput new FileOutputStream("${projectDir}/lib/buildid.txt")
}

Expand Down

0 comments on commit c3a9f9d

Please sign in to comment.