0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 14:10:33 +03:00
nixpkgs/pkgs/development/compilers/flutter/patches/copy-without-perms.patch

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
854 B
Diff
Raw Permalink Normal View History

diff --git a/packages/flutter_tools/lib/src/build_system/targets/assets.dart b/packages/flutter_tools/lib/src/build_system/targets/assets.dart
index 5f458bd53e..7a6c59f98d 100644
--- a/packages/flutter_tools/lib/src/build_system/targets/assets.dart
+++ b/packages/flutter_tools/lib/src/build_system/targets/assets.dart
@@ -128,7 +128,11 @@ Future<Depfile> copyAssets(
break;
}
if (doCopy) {
- await (content.file as File).copy(file.path);
+ // Not using File.copy because it preserves permissions.
+ final sourceFile = content.file as File;
+ final destinationFile = file;
+
+ await destinationFile.writeAsBytes(await sourceFile.readAsBytes(), flush: true);
}
} else {
await file.writeAsBytes(await entry.value.contentsAsBytes());