Skip to content

Commit

Permalink
fix rename script #125
Browse files Browse the repository at this point in the history
fix rename script #125

- Update the rename.sh script to handle project names with hyphens.
- Export the modified project name with underscores.
- Modify file references to use the exported project names.
- Move the directory `src/feelpp_project` to `src/<projectname_>`.
  • Loading branch information
prudhomm committed Nov 6, 2023
1 parent 9670ce2 commit c6e37f1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rename.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ else
projecttitle=$(create_title ${projectname})
shortprojectname=$( create_short_name $projectname )
appname="app"
projectname_="${projectname//-/_}"

fi

echo " project name: $projectname"
Expand All @@ -89,6 +91,7 @@ if [ "$1" == "-r" ]; then
fi

export projectname
export projectname_
export projecttitle
export shortprojectname
export appname
Expand All @@ -107,10 +110,12 @@ for i in "${files[@]}"
do
echo "processing renaming in $i ...."
perl -077pi.bak -e 's/feelpp-project/$ENV{'projectname'}/sg' $i
perl -077pi.bak -e 's/feelpp_project/$ENV{'projectname_'}/sg' $i
perl -077pi.bak -e 's/Feel\+\+ Template Project/$ENV{'projecttitle'}/sg' $i
perl -077pi.bak -e 's/\"fp\"/"$ENV{'shortprojectname'}"/sg' $i
perl -077pi.bak -e 's/myapp/$ENV{'appname'}/sg' $i
done
git mv src/feelpp_project src/$projectname_



Expand Down

0 comments on commit c6e37f1

Please sign in to comment.