This message was deleted.
# community-support
s
This message was deleted.
e
there is a
ignoreExitValue
property on
Exec
and
JavaExec
tasks (such as
run
). but I think it won't be passed on to the caller
if you're using the
application
plugin, try
./gradlew :myscript:install && myscript/build/install/myscript/bin/myscript "$@"
- this runs the program outside of Gradle
b
Thanks, I tried both suggestions. Adding the following lines to my gradle.build.kts did not change the error output:
Copy code
tasks.withType<Exec>().forEach {
    it.isIgnoreExitValue = true
}
Adjusting the launcher script did the trick:
Copy code
# shellcheck disable=SC2086
# shellcheck disable=SC2048
./gradlew :myscrip:install -q && ./build/install/myscript/bin/myscript $*
Looking at these options, I think the launcher script adjustment makes a lot of sense. Just for reference, did I make a mistake in the gradle.build.kts adjustment?
e
Copy code
tasks.run {
    isIgnoreExitValue = true
}
1.
run
is
JavaExec
, not
Exec
2. use
configureEach
to maintain lazy configuration… but better yet, only configure the specific task but the script approach is probably better for you anyway, because Gradle will still exit with success when the process exits with failure with
ignoreExitValue
, so the caller won't see it
đź’Ż 1