]> granicus.if.org Git - graphviz/commitdiff
replace use of grep in Windows CI task with Select-String
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 13 May 2021 01:49:25 +0000 (18:49 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 19 May 2021 14:42:13 +0000 (07:42 -0700)
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

index 3a04fd37f64e809bd400fc7c784cf719003ce191..62daef214935a91d586e50c2dedc1a520ba196b4 100644 (file)
@@ -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