From: Matthew Fernandez Date: Thu, 13 May 2021 01:49:25 +0000 (-0700) Subject: replace use of grep in Windows CI task with Select-String X-Git-Tag: 2.47.2~4^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=250cedc15727e0d07ef3c62bc6e33d9fd886bf2b;p=graphviz replace use of grep in Windows CI task with Select-String This warning counting can be achieved without the use of grep. This is a step towards removing grep as a Windows build dependency. Related to #2069. --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3a04fd37f..62daef214 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -142,7 +142,7 @@ portable-source: - $logfile = New-TemporaryFile - windows/bin/setup-build-utilities.ps1 2>&1 | tee $logfile - python ci/build_windows.py --build-system $env:build_system --platform $Env:project_platform --configuration $env:configuration 2>&1 | tee -a $logfile - - $warnings_count = Invoke-Expression "grep -c ' warning ' $logfile" + - $warnings_count = (Select-String -Pattern " warning " -Path $logfile).length - echo "$CI_JOB_NAME-warnings $warnings_count" > metrics.txt - rm $logfile - cat metrics.txt