From d6be4f55530549248b635132567db3c0d50ee0f5 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Tue, 3 Apr 2018 12:47:54 -0700 Subject: [PATCH] Fix powershell cat invocation to ensure correct encoding and line ending. (#16193) * Fix powershell cat invocation to ensure correct encoding and line ending. * Restore original flow for non-Windows platforms * Reformat code to get rid of multi-line ?: expression * Double quotes to single quotes --- dev/bots/test.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dev/bots/test.dart b/dev/bots/test.dart index 14bf481bec..3dd630ac0b 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -75,11 +75,12 @@ Future _verifyInternationalizations() async { final String localizationsFile = path.join('packages', 'flutter_localizations', 'lib', 'src', 'l10n', 'localizations.dart'); - final EvalResult sourceContents = await _evalCommand( - 'cat', - [localizationsFile], - workingDirectory: flutterRoot, - ); + final String executable = Platform.isWindows ? 'powershell' : 'cat'; + final List args = Platform.isWindows ? + ['\$PSDefaultParameterValues["*:Encoding"]="utf8";(gc $localizationsFile) -join "`n"']: + [localizationsFile]; + + final EvalResult sourceContents = await _evalCommand(executable, args, workingDirectory: flutterRoot); if (genResult.stdout.trim() != sourceContents.stdout.trim()) { stderr