Improving onos-create-app script to print message when artifactId is not provided on command line.
This replaces the "onos-create-app: line 31: [: argument expected" error message.
Change-Id: I58e08f302edf2a5068adf993cdbc55e71b9578bf
diff --git a/tools/dev/bin/onos-create-app b/tools/dev/bin/onos-create-app
index 279ec06..65b00b6 100755
--- a/tools/dev/bin/onos-create-app
+++ b/tools/dev/bin/onos-create-app
@@ -28,7 +28,15 @@
-DarchetypeVersion=$ONOS_POM_VERSION $otherOptions "$@"
# Patch the pom.xml file to make this an app.
-if [ $type = app -a -d $dir ]; then
- egrep -v " (<!--|-->)" $dir/pom.xml > $dir/pom.app.xml
- mv $dir/pom.app.xml $dir/pom.xml
-fi
\ No newline at end of file
+if [ $type = app ]; then
+ # We need to add a few lines to the pom.xml to make this an app
+ if [ -n "$dir" ] && [ -d $dir ]; then
+ egrep -v " (<!--|-->)" $dir/pom.xml > $dir/pom.app.xml
+ mv $dir/pom.app.xml $dir/pom.xml
+ else
+ echo
+ echo "IMPORTANT:"
+ echo "To build the application, you need to uncomment the 'onos.app.name' and 'onos.app.origin' properties in the pom.xml"
+ echo
+ fi
+fi