File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -163,17 +163,15 @@ export async function renameProject(
163163 */
164164export async function copyProject (
165165 storage : commonStorage . Storage , projectName : string , newProjectName : string ) : Promise < void > {
166- const modulePaths : string [ ] = await storage . listFilePaths (
167- storageNames . makeModulePathRegexPattern ( projectName ) ) ;
166+ const projectFileNames : string [ ] = await storage . list (
167+ storageNames . makeProjectDirectoryPath ( projectName ) ) ;
168168
169- for ( const modulePath of modulePaths ) {
170- const className = storageNames . getClassName ( modulePath ) ;
171- const moduleType = storageNames . getModuleType ( modulePath ) ;
172- const newModulePath = storageNames . makeModulePath ( newProjectName , className , moduleType ) ;
173- const moduleContentText = await storage . fetchFileContentText ( modulePath ) ;
174- await storage . saveFile ( newModulePath , moduleContentText ) ;
169+ for ( const projectFileName of projectFileNames ) {
170+ const filePath = storageNames . makeFilePath ( projectName , projectFileName ) ;
171+ const newFilePath = storageNames . makeFilePath ( newProjectName , projectFileName ) ;
172+ const fileContentText = await storage . fetchFileContentText ( filePath ) ;
173+ await storage . saveFile ( newFilePath , fileContentText ) ;
175174 }
176- await saveProjectInfo ( storage , newProjectName ) ;
177175}
178176
179177/**
You can’t perform that action at this time.
0 commit comments