промежуточный. ликвидировал велосипед с копированием папок

This commit is contained in:
2023-10-02 19:11:24 +03:00
parent 1934863bff
commit 6372fce1ac
3 changed files with 5 additions and 22 deletions

View File

@@ -1036,25 +1036,5 @@ public class Utils {
}
return false;
}
public static void copyDirectory(File src, File dst) throws Exception {
int code = Constants.Nan;
String command =
Global.isWindows ?
("xcopy " +
Utils.DQuotes(src.getAbsolutePath()) + " " +
Utils.DQuotes(dst.getAbsolutePath()) + " /e")
:
("cp -r " + Utils.DQuotes(src.getAbsolutePath()) + " " +
Utils.DQuotes(dst.getAbsolutePath())
);
try {
code = Runtime.getRuntime().exec(command).waitFor();
} catch (Exception ex) {
ex.printStackTrace();
throw new PassException("Команда " + command + " завершилась с исключением.");
}
if (code != 0)
throw new PassException("Команда " + command + " завершилась с кодом " + code);
}
}

View File

@@ -266,7 +266,7 @@ public class StartSapforTests extends Pass_2021<SapforScenario> {
File taskWorkspace = new File(sapforTasksPackage.workspace, test.description);
Utils.CheckAndCleanDirectory(taskWorkspace);
//--
Utils.copyDirectory(new File(Global.TestsDirectory, test.id), taskWorkspace);
FileUtils.copyDirectory(new File(Global.TestsDirectory, test.id), taskWorkspace);
}
}
Global.db.Update(sapforTasksPackage);