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

This commit is contained in:
Michael Goderbauer 2019-08-28 15:20:47 -07:00 committed by GitHub
parent cb965495d7
commit 0b23634fb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -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',

View File

@ -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,