From 250cedc15727e0d07ef3c62bc6e33d9fd886bf2b Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Wed, 12 May 2021 18:49:25 -0700 Subject: [PATCH] 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. --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.50.1