File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Card Creator/src/main/java/vv3ird/populatecard/control Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -439,14 +439,16 @@ public static Path importZipProject(Path sourceFile) {
439439 Project p = Project .load (projectFile );
440440 targetRoot = Paths .get ("projects" , p .getName ());
441441 int i = 0 ;
442+ boolean renamedProject = false ;
442443 while (Files .exists (targetRoot )) {
443444 targetRoot = Paths .get ("projects" , p .getName () + "_" + ++i );
445+ renamedProject = true ;
444446 }
445447 System .out .println ("Source Root: " + sourceRoot );
446448 System .out .println ("Target Root: " + targetRoot );
447449 Files .createDirectories (targetRoot );
448450 Files .walkFileTree (sourceRoot , new CopyFileVisitor (targetRoot ));
449- targetProject = Paths .get ("projects" , p .getName () + "_" + i , projectFile .getFileName ().toString ());
451+ targetProject = Paths .get ("projects" , p .getName () + ( renamedProject ? "_" + i : "" ) , projectFile .getFileName ().toString ());
450452 }
451453 return targetProject ;
452454 }
You can’t perform that action at this time.
0 commit comments