mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Use FileUtils to handle copying of migrated repository
This commit is contained in:
parent
1a646d3fd0
commit
f852cd603d
1 changed files with 5 additions and 11 deletions
|
@ -89,18 +89,12 @@ public class FSGitRepoStore implements RepoStore {
|
|||
sourcePath,
|
||||
destinationPath
|
||||
);
|
||||
new ProcessBuilder(
|
||||
"rm", "-rf",
|
||||
destinationPath
|
||||
).start();
|
||||
Process copyProcess = new ProcessBuilder(
|
||||
"cp", "-ra",
|
||||
sourcePath,
|
||||
destinationPath + "/"
|
||||
).start();
|
||||
try {
|
||||
copyProcess.waitFor();
|
||||
} catch (InterruptedException e) {
|
||||
File source = new File(sourcePath);
|
||||
File destination = new File(destinationPath);
|
||||
FileUtils.deleteDirectory(destination);
|
||||
FileUtils.copyDirectory(source, destination);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new IOException("copy failed" + e.getLocalizedMessage());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue