Skip to content

Commit

Permalink
Add param check for includes. Fix error syntax for files. (#110)
Browse files Browse the repository at this point in the history
* Add param check for includes. Fix error syntax for files.

* Move INCLUDES to last arg.
  • Loading branch information
petermcneely authored and mdkess committed Feb 13, 2019
1 parent 34c804c commit 2590581
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions gwy/generate_gateway.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,15 @@ while test $# -gt 0; do
;;
-i|--includes)
shift
INCLUDES="$INCLUDES -i $1"
shift
if test $# -gt 0; then
INCLUDES="$INCLUDES -i $1"
shift
else
echo "Missing extra include directory name for --includes."
echo ""
printUsage
exit 1
fi
;;
-f|--file)
shift
Expand All @@ -40,7 +47,7 @@ while test $# -gt 0; do
shift
else
echo "Missing file name for --file."
echo""
echo ""
printUsage
exit 1
fi
Expand Down Expand Up @@ -94,7 +101,7 @@ fi

# Generate the gateway files in src
PROTO_DIR=$(dirname $FILE)
entrypoint.sh $INCLUDES -d $PROTO_DIR -l go --with-gateway -o $OUT_DIR/src/gen/pb-go
entrypoint.sh -d $PROTO_DIR -l go --with-gateway -o $OUT_DIR/src/gen/pb-go $INCLUDES

# Find the Swagger file.
PROTO_FILE=$(basename $FILE)
Expand Down

0 comments on commit 2590581

Please sign in to comment.