Commit 08f87038 authored by Brian Sidebotham's avatar Brian Sidebotham Committed by Dick Hollenbeck

Fixes a bug in the template file copying mechanism. The previous code failed...

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.
parent 8c75adb8
...@@ -139,7 +139,13 @@ bool PROJECT_TEMPLATE::CreateProject( wxFileName& aNewProjectPath ) ...@@ -139,7 +139,13 @@ bool PROJECT_TEMPLATE::CreateProject( wxFileName& aNewProjectPath )
destname += wxT(".") + destination.GetExt(); destname += wxT(".") + destination.GetExt();
wxString destpath = destination.GetPathWithSep(); 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; destination = destpath + destname;
dstFiles.push_back( destination ); dstFiles.push_back( destination );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment