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

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
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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 );