Do not hide .git in zip for Windows (#39432)
This commit is contained in:
parent
cb965495d7
commit
0b23634fb3
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user