File tree Expand file tree Collapse file tree
cli/src/main/java/com/devonfw/tools/ide/io Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -308,7 +308,11 @@ public Path backup(Path fileOrFolder) {
308308 String date = DateTimeUtil .formatDate (now , true );
309309 String time = DateTimeUtil .formatTime (now );
310310 String filename = fileOrFolder .getFileName ().toString ();
311- Path backupPath = this .context .getIdeHome ().resolve (IdeContext .FOLDER_BACKUPS ).resolve (date ).resolve (time + "_" + filename );
311+ Path backupBaseDir = this .context .getIdeHome ();
312+ if (backupBaseDir == null ) {
313+ backupBaseDir = this .context .getIdePath ();
314+ }
315+ Path backupPath = backupBaseDir .resolve (IdeContext .FOLDER_BACKUPS ).resolve (date ).resolve (time + "_" + filename );
312316 backupPath = appendParentPath (backupPath , fileOrFolder .getParent (), 2 );
313317 mkdirs (backupPath );
314318 Path target = backupPath .resolve (filename );
You can’t perform that action at this time.
0 commit comments