Unverified Commit 0b23634f authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Do not hide .git in zip for Windows (#39432)

parent cb965495
......@@ -414,9 +414,14 @@ class ArchiveCreator {
}
/// 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',
......
......@@ -122,6 +122,7 @@ void main() {
'$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 @@ void main() {
'$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 @@ void main() {
'$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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment