From f662a3dba90207770e7c89b6231a823e28a4e24c Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Thu, 15 Jul 2021 17:22:39 +0200 Subject: [PATCH] Rename pgpainless run script and fix parameter passing --- pgpainless-cli/build.gradle | 7 +++++++ pgpainless-cli/{pgpainless => pgpainless-cli} | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) rename pgpainless-cli/{pgpainless => pgpainless-cli} (70%) diff --git a/pgpainless-cli/build.gradle b/pgpainless-cli/build.gradle index cae9c78f..5d24d8a1 100644 --- a/pgpainless-cli/build.gradle +++ b/pgpainless-cli/build.gradle @@ -63,4 +63,11 @@ jar { } } +run { + // https://discuss.gradle.org/t/how-can-i-provide-command-line-args-to-application-started-with-gradle-run/6474/5 + if (project.hasProperty("appArgs")) { + args Eval.me(appArgs) + } +} + tasks."jar".dependsOn(":pgpainless-core:assemble") diff --git a/pgpainless-cli/pgpainless b/pgpainless-cli/pgpainless-cli similarity index 70% rename from pgpainless-cli/pgpainless rename to pgpainless-cli/pgpainless-cli index c65ffd6c..61e01400 100755 --- a/pgpainless-cli/pgpainless +++ b/pgpainless-cli/pgpainless-cli @@ -15,4 +15,8 @@ popd > /dev/null BASEDIR="$(cd ${SCRIPTDIR}/.. && pwd)" -exec "${BASEDIR}/gradlew" run --quiet --args="${@}" +# https://discuss.gradle.org/t/how-can-i-provide-command-line-args-to-application-started-with-gradle-run/6474/5 +printf -v var "'%s', " "$@" +var=${var%??} + +exec "${BASEDIR}/gradlew" run --quiet -PappArgs="[$var]"