Unverified Commit 0b6c1938 authored by Greg Spencer's avatar Greg Spencer Committed by GitHub

Fix gsutil argument order. (#14808)

parent 382ee4ba
......@@ -487,14 +487,13 @@ class ArchivePublisher {
if (dest.endsWith('.json')) {
mimeType = 'application/json';
}
final List<String> args = <String>['cp'];
final List<String> args = <String>[];
// Use our preferred MIME type for the files we care about
// and let gsutil figure it out for anything else.
if (mimeType != null) {
args.addAll(<String>['-h', 'Content-Type:$mimeType']);
}
args.add(src);
args.add(dest);
args.addAll(<String>['cp', src, dest]);
return _runGsUtil(args);
}
}
......
......@@ -239,10 +239,10 @@ void main() {
''';
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
'gsutil rm $gsArchivePath': null,
'gsutil cp -h Content-Type:$archiveMime $archivePath $gsArchivePath': null,
'gsutil -h Content-Type:$archiveMime cp $archivePath $gsArchivePath': null,
'gsutil cat $gsJsonPath': <ProcessResult>[new ProcessResult(0, 0, releasesJson, '')],
'gsutil rm $gsJsonPath': null,
'gsutil cp -h Content-Type:application/json $jsonPath $gsJsonPath': null,
'gsutil -h Content-Type:application/json cp $jsonPath $gsJsonPath': null,
};
processManager.fakeResults = calls;
final File outputFile = new File(path.join(tempDir.absolute.path, archiveName));
......
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