From bb3f83d46b3913fba178eca4c55ca18dfb1cf38b Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Tue, 7 May 2024 21:31:41 +0600 Subject: [PATCH] cd: windows choco copy failed --- cli/commands/build/windows.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cli/commands/build/windows.dart b/cli/commands/build/windows.dart index c44a60745..15e0bf170 100644 --- a/cli/commands/build/windows.dart +++ b/cli/commands/build/windows.dart @@ -63,7 +63,7 @@ class WindowsBuildCommand extends Command with BuildCommandCommonSteps { final exeFile = File(exePath); - final hash = sha256.convert(exeFile.readAsBytesSync()).toString(); + final hash = sha256.convert(await exeFile.readAsBytes()).toString(); final chocoVerificationFile = File(chocoFiles.first); @@ -74,8 +74,9 @@ class WindowsBuildCommand extends Command with BuildCommandCommonSteps { ), ); - final chocoToolsPath = join(cwd.path, "choco-struct", "tools"); - exeFile.copySync(chocoToolsPath); + await exeFile.copy( + join(cwd.path, "choco-struct", "tools", basename(exeFile.path)), + ); await shell.run( "choco pack ${chocoFiles[1]} --outputdirectory ${join(cwd.path, "dist")}",