Skip to content

Commit

Permalink
Move error logging into command execution point
Browse files Browse the repository at this point in the history
  • Loading branch information
ayeshLK committed Jun 26, 2024
1 parent 6204f17 commit 7c1d7e0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/groovy/io/ballerina/plugin/BallerinaPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ class BallerinaPlugin implements Plugin<Project> {
bal pack --target-dir ${balBuildTarget}"
"""
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'cmd', '/c', "$balPackWithDocker"
commandLine 'cmd', '/c', "$balPackWithDocker && exit %%ERRORLEVEL%%"
} else {
commandLine 'sh', '-c', "$balPackWithDocker"
}
Expand Down Expand Up @@ -321,7 +321,7 @@ class BallerinaPlugin implements Plugin<Project> {
bal push ${balBuildTarget}/bala/${packageOrg}-${packageName}-${platform}-${balaVersion}.bala"
"""
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'cmd', '/c', "$balPushWithDocker"
commandLine 'cmd', '/c', "$balPushWithDocker && exit %%ERRORLEVEL%%"
} else {
commandLine 'sh', '-c', "$balPushWithDocker"
}
Expand Down Expand Up @@ -383,10 +383,10 @@ class BallerinaPlugin implements Plugin<Project> {
-v $projectDirectory:/home/ballerina/$parentDirectory.name/$projectDirectory.name \
ballerina/ballerina:$ballerinaDockerTag \
/bin/sh -c "cd $parentDirectory.name/$projectDirectory.name && \
$balJavaDebugParam bal test ${graalvmFlag} ${parallelTestFlag} ${testCoverageParams} ${groupParams} ${disableGroups} ${debugParams}&& exit %%ERRORLEVEL%% "
$balJavaDebugParam bal test ${graalvmFlag} ${parallelTestFlag} ${testCoverageParams} ${groupParams} ${disableGroups} ${debugParams}"
"""
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'cmd', '/c', "$balTestWithDocker"
commandLine 'cmd', '/c', "$balTestWithDocker && exit %%ERRORLEVEL%%"
} else {
commandLine 'sh', '-c', "$balTestWithDocker"
}
Expand All @@ -413,7 +413,7 @@ class BallerinaPlugin implements Plugin<Project> {
/bin/sh -c "find /home/ballerina/$parentDirectory.name -type d -name 'build' -exec rm -rf {} + && find /home/ballerina/$parentDirectory.name -type d -name 'target' -exec rm -rf {} +"
"""
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'cmd', '/c', "$deleteUsingDocker"
commandLine 'cmd', '/c', "$deleteUsingDocker && exit %%ERRORLEVEL%%"
} else {
commandLine 'sh', '-c', "$deleteUsingDocker"
}
Expand Down

0 comments on commit 7c1d7e0

Please sign in to comment.