From b2bd7edfe542c6bcc1e15513f852bb30ef8dde98 Mon Sep 17 00:00:00 2001 From: Brian O'Connor Date: Mon, 22 Jun 2015 13:36:26 -0400 Subject: [PATCH] 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 --- tools/dev/bin/onos-create-app | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/dev/bin/onos-create-app b/tools/dev/bin/onos-create-app index 279ec06170..65b00b65f9 100755 --- a/tools/dev/bin/onos-create-app +++ b/tools/dev/bin/onos-create-app @@ -28,7 +28,15 @@ mvn archetype:generate -DarchetypeGroupId=org.onosproject \ -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