Fixes a bug in the template file copying mechanism. The previous code failed to honour sub-directorys and flattened the whole tree whilst copying files.

I have fixed this so that sub-directories that are not the meta directory will get copied verbatim into the new project directory.
This commit is contained in:
Brian Sidebotham 2013-01-01 14:39:25 -06:00 committed by Dick Hollenbeck
parent 8c75adb8c1
commit 08f8703898
1 changed files with 7 additions and 1 deletions

View File

@ -139,7 +139,13 @@ bool PROJECT_TEMPLATE::CreateProject( wxFileName& aNewProjectPath )
destname += wxT(".") + destination.GetExt();
wxString destpath = destination.GetPathWithSep();
destpath.Replace( destination.GetPathWithSep(), aNewProjectPath.GetPathWithSep() );
destpath.Replace( templateBasePath.GetPathWithSep(), aNewProjectPath.GetPathWithSep() );
// Check to see if the path already exists, if not attempt to create it here. Don't worry
// about error checking, if the path isn't created the file copy will fail anyway
if( !wxFileName::DirExists( destpath ) )
wxFileName::Mkdir( destpath, 0777, wxPATH_MKDIR_FULL );
destination = destpath + destname;
dstFiles.push_back( destination );