Skip to content

Commit

Permalink
Merge pull request #145 from ayeshLK/main
Browse files Browse the repository at this point in the history
Add an error log for cases where the bala-directory is not generated
  • Loading branch information
ayeshLK authored Jun 27, 2024
2 parents 4a0d0a8 + a4dccce commit 539b1fa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/groovy/io/ballerina/plugin/BallerinaPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,13 @@ class BallerinaPlugin implements Plugin<Project> {
}
}
}

def balaPath = "$project.projectDir/${balBuildTarget}/bala"
if (!Files.exists(balaPath)) {
println("[Error] 'bala' directory does not exist: ${balaPath}, hence exiting")
return
}

// extract bala file to balaArtifact
new File("$project.projectDir/${balBuildTarget}/bala").eachFileMatch(~/.*.bala/) { balaFile ->
project.copy {
Expand Down

0 comments on commit 539b1fa

Please sign in to comment.