Fix gsutil.py call for windows (#27113)
This commit is contained in:
parent
f131c80b10
commit
0e54e9fc36
@ -533,6 +533,14 @@ class ArchivePublisher {
|
|||||||
Directory workingDirectory,
|
Directory workingDirectory,
|
||||||
bool failOk = false,
|
bool failOk = false,
|
||||||
}) async {
|
}) async {
|
||||||
|
if (platform.isWindows) {
|
||||||
|
return _processRunner.runProcess(
|
||||||
|
<String>['python', path.join(platform.environment['DEPOT_TOOLS'], 'gsutil.py'), '--']..addAll(args),
|
||||||
|
workingDirectory: workingDirectory,
|
||||||
|
failOk: failOk,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return _processRunner.runProcess(
|
return _processRunner.runProcess(
|
||||||
<String>['gsutil.py', '--']..addAll(args),
|
<String>['gsutil.py', '--']..addAll(args),
|
||||||
workingDirectory: workingDirectory,
|
workingDirectory: workingDirectory,
|
||||||
|
@ -38,7 +38,9 @@ void main() {
|
|||||||
for (String platformName in <String>['macos', 'linux', 'windows']) {
|
for (String platformName in <String>['macos', 'linux', 'windows']) {
|
||||||
final FakePlatform platform = FakePlatform(
|
final FakePlatform platform = FakePlatform(
|
||||||
operatingSystem: platformName,
|
operatingSystem: platformName,
|
||||||
environment: <String, String>{},
|
environment: <String, String>{
|
||||||
|
'DEPOT_TOOLS': path.join('D:', 'depot_tools'),
|
||||||
|
},
|
||||||
);
|
);
|
||||||
group('ProcessRunner for $platform', () {
|
group('ProcessRunner for $platform', () {
|
||||||
test('Returns stdout', () async {
|
test('Returns stdout', () async {
|
||||||
@ -256,12 +258,15 @@ void main() {
|
|||||||
}
|
}
|
||||||
''';
|
''';
|
||||||
File(jsonPath).writeAsStringSync(releasesJson);
|
File(jsonPath).writeAsStringSync(releasesJson);
|
||||||
|
final String gsutilCall = platform.isWindows
|
||||||
|
? 'python ${path.join("D:", "depot_tools", "gsutil.py")}'
|
||||||
|
: 'gsutil.py';
|
||||||
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
|
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
|
||||||
'gsutil.py -- rm $gsArchivePath': null,
|
'$gsutilCall -- rm $gsArchivePath': null,
|
||||||
'gsutil.py -- -h Content-Type:$archiveMime cp $archivePath $gsArchivePath': null,
|
'$gsutilCall -- -h Content-Type:$archiveMime cp $archivePath $gsArchivePath': null,
|
||||||
'gsutil.py -- cp $gsJsonPath $jsonPath': null,
|
'$gsutilCall -- cp $gsJsonPath $jsonPath': null,
|
||||||
'gsutil.py -- rm $gsJsonPath': null,
|
'$gsutilCall -- rm $gsJsonPath': null,
|
||||||
'gsutil.py -- -h Content-Type:application/json cp $jsonPath $gsJsonPath': null,
|
'$gsutilCall -- -h Content-Type:application/json cp $jsonPath $gsJsonPath': null,
|
||||||
};
|
};
|
||||||
processManager.fakeResults = calls;
|
processManager.fakeResults = calls;
|
||||||
final File outputFile = File(path.join(tempDir.absolute.path, archiveName));
|
final File outputFile = File(path.join(tempDir.absolute.path, archiveName));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user