Brian O'Connor

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
...@@ -28,7 +28,15 @@ mvn archetype:generate -DarchetypeGroupId=org.onosproject \ ...@@ -28,7 +28,15 @@ mvn archetype:generate -DarchetypeGroupId=org.onosproject \
28 -DarchetypeVersion=$ONOS_POM_VERSION $otherOptions "$@" 28 -DarchetypeVersion=$ONOS_POM_VERSION $otherOptions "$@"
29 29
30 # Patch the pom.xml file to make this an app. 30 # Patch the pom.xml file to make this an app.
31 -if [ $type = app -a -d $dir ]; then
32 - egrep -v " (<!--|-->)" $dir/pom.xml > $dir/pom.app.xml
33 - mv $dir/pom.app.xml $dir/pom.xml
34 -fi
...\ No newline at end of file ...\ No newline at end of file
31 +if [ $type = app ]; then
32 + # We need to add a few lines to the pom.xml to make this an app
33 + if [ -n "$dir" ] && [ -d $dir ]; then
34 + egrep -v " (<!--|-->)" $dir/pom.xml > $dir/pom.app.xml
35 + mv $dir/pom.app.xml $dir/pom.xml
36 + else
37 + echo
38 + echo "IMPORTANT:"
39 + echo "To build the application, you need to uncomment the 'onos.app.name' and 'onos.app.origin' properties in the pom.xml"
40 + echo
41 + fi
42 +fi
......