checkpoint

This commit is contained in:
Alessandro Autiero
2023-02-24 15:24:24 +01:00
parent 013d15d7ff
commit 63c7cc5c5b
69 changed files with 1148 additions and 644 deletions

View File

@@ -51,12 +51,19 @@ Future<List<FortniteBuild>> fetchBuilds(ignored) async {
Future<Process> downloadManifestBuild(
String manifestUrl, String destination, Function(double, String) onProgress) async {
var buildExe = await loadBinary("build.exe", false);
var log = await loadBinary("download.txt", true);
await log.create();
var buildExe = await loadBinary("build.exe", true);
var process = await Process.start(buildExe.path, [manifestUrl, destination]);
log.writeAsString("Starting download of: $manifestUrl\n", mode: FileMode.append);
process.errLines
.where((message) => message.contains("%"))
.forEach((message) => onProgress(double.parse(message.split("%")[0]), message.substring(message.indexOf(" ") + 1)));
.forEach((message) {
log.writeAsString("$message\n", mode: FileMode.append);
onProgress(double.parse(message.split("%")[0]), message.substring(message.indexOf(" ") + 1));
});
return process;
}
@@ -104,7 +111,7 @@ Future<void> downloadArchiveBuild(String archiveUrl, String destination,
var shell = Shell(
commandVerbose: false,
commentVerbose: false,
workingDirectory: safeBinariesDirectory
workingDirectory: safeBinariesDirectory.path
);
await shell.run("./winrar.exe x \"${tempFile.path}\" *.* \"${output.path}\"");
} finally {