From 03953b3744c8f95c888f3fea60f2b0435210ae38 Mon Sep 17 00:00:00 2001
From: Alejandro Lopez Gestoso <alopez@iri.upc.edu>
Date: Fri, 8 Mar 2019 16:26:50 +0100
Subject: [PATCH] Fixed a bug on new_project.sh related to -p argument
 (project_description).

---
 ReadMe.md          |  2 +-
 ReadMe_template.md |  2 ++
 new_project.sh     | 14 ++++++++------
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/ReadMe.md b/ReadMe.md
index b82d386..c5acfa5 100644
--- a/ReadMe.md
+++ b/ReadMe.md
@@ -29,7 +29,7 @@ Execute the *new_project.sh* script with the following parameters:
 
 * **-n project\_name**: this parameter is required. It specifies the name of the shared library or the binary file to be generate by the project. **This parameter must not have any whitespace characters**.
 
-* **-i comma\_separated\_dependencies**: this parameter is optional. It specifies a set of dependencies of the library or application being generated. These depedencies will be automatically included inside the CMake structure. Only dependencies supported by the CMake framework are currently supported.
+* **-d comma\_separated\_dependencies**: this parameter is optional. It specifies a set of dependencies of the library or application being generated. These depedencies will be automatically included inside the CMake structure. Only dependencies supported by the CMake framework are currently supported.
 
 * **-g**: this parameters is optional. Is specifies whether the test strcture is to be included into the project or not. This includes the necessaty CMake files to download and locally build the google test software and a basic test file for the generated project.
 
diff --git a/ReadMe_template.md b/ReadMe_template.md
index 465d48e..800bac7 100755
--- a/ReadMe_template.md
+++ b/ReadMe_template.md
@@ -3,6 +3,8 @@ project_name                        {#mainpage}
 
 ## Description
 
+project_description
+
 ## Dependencies
 
 This package requires of the following system libraries and packages
diff --git a/new_project.sh b/new_project.sh
index 7e7cfc3..05efd2f 100755
--- a/new_project.sh
+++ b/new_project.sh
@@ -2,7 +2,7 @@
 
 DEP=
 TYPE=
-PROJECT_NAME=
+PROJECT_DESC=
 NAME=
 TEST=0
 
@@ -13,7 +13,7 @@ do
        TYPE=$OPTARG
        ;;
     p)
-       PROJECT_NAME=$OPTARG
+       PROJECT_DESC=$OPTARG
        ;;
     n)
        NAME=$OPTARG
@@ -41,9 +41,9 @@ case $TYPE in
      ;;
 esac
 
-if [ "$PROJECT_NAME" ]
+if [ "$NAME" ]
 then
-  echo "Generating folder structure for project $PROJECT_NAME ..."
+  echo "Generating folder structure for project $NAME ..."
 else
   echo "No project name provided, aborting ..."  
   exit
@@ -152,9 +152,11 @@ sed 's/author_email/labrobotica@iri.upc.edu/g' <ReadMe_template.md >tmp1.md
 #set the author's name on the ReadMe.txt disclaimer file
 sed 's/author_name/IRI labrobotics/g' <tmp1.md >tmp2.md
 #Set the project name on the ReadMe.txt disclaimer file
-sed 's/project_name/'"$PROJECT_NAME"'/g' <tmp2.md >./ReadMe.md
+sed 's/project_description/'"$PROJECT_DESC"'/g' <tmp2.md >tmp3.md
+sed 's/project_name/'"$NAME"'/g' <tmp3.md >./ReadMe.md
 rm tmp1.md
 rm tmp2.md
+rm tmp3.md
 rm ReadMe_template.md
 
 #Set the project name on the CMakeLists.txt script file
@@ -169,7 +171,7 @@ rm CMakeLists_test_template.txt
 rm CMakeLists_template.txt
 
 #Set the project name on the doxygen_project_name.dox sript file
-sed 's/project_name/'"$PROJECT_NAME"'/g' <doxygen_project_name_template.conf >./doc/doxygen_project_name.conf
+sed 's/project_name/'"$NAME"'/g' <doxygen_project_name_template.conf >./doc/doxygen_project_name.conf
 rm doxygen_project_name_template.conf
 mv doxygen_template.conf ./doc/doxygen.conf
 
-- 
GitLab