Do not hide .git in zip for Windows (#39432)
diff --git a/dev/bots/prepare_package.dart b/dev/bots/prepare_package.dart
index 843966d..2f42a43 100644
--- a/dev/bots/prepare_package.dart
+++ b/dev/bots/prepare_package.dart
@@ -414,9 +414,14 @@
}
/// Create a zip archive from the directory source.
- Future<String> _createZipArchive(File output, Directory source) {
+ Future<String> _createZipArchive(File output, Directory source) async {
List<String> commandLine;
if (platform.isWindows) {
+ // Unhide the .git folder, https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/attrib.
+ await _processRunner.runProcess(
+ <String>['attrib', '-h', '.git'],
+ workingDirectory: Directory(source.absolute.path),
+ );
commandLine = <String>[
'7za',
'a',
diff --git a/dev/bots/test/prepare_package_test.dart b/dev/bots/test/prepare_package_test.dart
index 78c958b..78a5cc6 100644
--- a/dev/bots/test/prepare_package_test.dart
+++ b/dev/bots/test/prepare_package_test.dart
@@ -122,6 +122,7 @@
'$flutter create --template=package ${createBase}package': null,
'$flutter create --template=plugin ${createBase}plugin': null,
'git clean -f -X **/.packages': null,
+ if (platform.isWindows) 'attrib -h .git': null,
if (platform.isWindows) '7za a -tzip -mx=9 $archiveName flutter': null
else if (platform.isMacOS) 'zip -r -9 $archiveName flutter': null
else if (platform.isLinux) 'tar cJf $archiveName flutter': null,
@@ -156,6 +157,7 @@
'$flutter create --template=package ${createBase}package': null,
'$flutter create --template=plugin ${createBase}plugin': null,
'git clean -f -X **/.packages': null,
+ if (platform.isWindows) 'attrib -h .git': null,
if (platform.isWindows) '7za a -tzip -mx=9 $archiveName flutter': null
else if (platform.isMacOS) 'zip -r -9 $archiveName flutter': null
else if (platform.isLinux) 'tar cJf $archiveName flutter': null,
@@ -205,6 +207,7 @@
'$flutter create --template=package ${createBase}package': null,
'$flutter create --template=plugin ${createBase}plugin': null,
'git clean -f -X **/.packages': null,
+ if (platform.isWindows) 'attrib -h .git': null,
if (platform.isWindows) '7za a -tzip -mx=9 $archiveName flutter': null
else if (platform.isMacOS) 'zip -r -9 $archiveName flutter': null
else if (platform.isLinux) 'tar cJf $archiveName flutter': null,