mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-10 18:59:39 +02:00
Rename pgpainless run script and fix parameter passing
This commit is contained in:
parent
8cf5347b52
commit
f662a3dba9
2 changed files with 12 additions and 1 deletions
22
pgpainless-cli/pgpainless-cli
Executable file
22
pgpainless-cli/pgpainless-cli
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Pretty fancy method to get reliable the absolute path of a shell
|
||||
# script, *even if it is sourced*. Credits go to GreenFox on
|
||||
# stackoverflow: http://stackoverflow.com/a/12197518/194894
|
||||
pushd . > /dev/null
|
||||
SCRIPTDIR="${BASH_SOURCE[0]}";
|
||||
while([ -h "${SCRIPTDIR}" ]); do
|
||||
cd "`dirname "${SCRIPTDIR}"`"
|
||||
SCRIPTDIR="$(readlink "`basename "${SCRIPTDIR}"`")";
|
||||
done
|
||||
cd "`dirname "${SCRIPTDIR}"`" > /dev/null
|
||||
SCRIPTDIR="`pwd`";
|
||||
popd > /dev/null
|
||||
|
||||
BASEDIR="$(cd ${SCRIPTDIR}/.. && pwd)"
|
||||
|
||||
# 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]"
|
Loading…
Add table
Add a link
Reference in a new issue