Skip to content

Commit

Permalink
Add an error log for cases where the bala-directory is not generated
Browse files Browse the repository at this point in the history
  • Loading branch information
ayeshLK committed Jun 27, 2024
1 parent 7c1d7e0 commit a4dccce
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 a4dccce

Please sign in to comment.