Skip to content

Instantly share code, notes, and snippets.

@nitay
Created August 22, 2016 19:59
Show Gist options
  • Save nitay/0cf2d8421e6f0595fd0da271e269fc9a to your computer and use it in GitHub Desktop.
Save nitay/0cf2d8421e6f0595fd0da271e269fc9a to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ $# < 1 ]]; then
echo "Usage: $0 [-Doption1] [-Doption2] target [arg1] [arg2]"
exit
fi
options=""
args=""
target=""
for arg in "$@"; do
if [[ $arg == -D* ]]; then
options="$options --jvm-options=$arg"
else
if [[ -z $target ]]; then
target=$arg
else
args="$args --jvm-program-args=$arg"
fi
fi
done
cmd="./pants run $options $target $args"
echo $cmd
$cmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment