Skip to content

Commit

Permalink
Merge pull request coding#36 from Coding/tanhehe/run_command_support_…
Browse files Browse the repository at this point in the history
…port_param

ide.sh run command support port param
  • Loading branch information
tanhe123 authored Oct 8, 2016
2 parents c9231d2 + e5fc2e7 commit e06c247
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions ide.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ sub_help(){
echo ""
echo "Subcommands:"
echo " build"
echo " run"
echo " run [-p port]"
echo " docker [build|run|attach|stop|logs|exec]"
echo ""
echo "For help with each subcommand run:"
Expand Down Expand Up @@ -220,29 +220,44 @@ sub_docker() {

do_run_backend() {
cd $BACKEND
mvn clean spring-boot:run
mvn clean spring-boot:run ${1}
cd $BASEDIR
}

sub_run() {
local OPTIND opt

run_usage() {
echo "Usage: $PROG_NAME run"
echo "Usage: $PROG_NAME run [-p port]"
}

# process options
while getopts ":p:" opt; do
case $opt in
p)
EXTRA_VARS=-Drun.arguments="--server.port=${OPTARG}"
;;
\?)
build_usage
exit 1
;;
esac
done

shift $((OPTIND-1))

case $1 in
"-h" | "--help")
run_usage
;;
"")
do_run_backend
do_run_backend $EXTRA_VARS
;;
esac
}

# process subcommands

subcommand=$1

case $subcommand in
"" | "-h" | "--help")
sub_help
Expand Down

0 comments on commit e06c247

Please sign in to comment.