set strict mode for ExportInHeader.ps1

This commit is contained in:
silverqx
2021-11-16 18:35:05 +01:00
parent 911a83266a
commit e7634156f1
+4 -2
View File
@@ -1,3 +1,5 @@
Set-StrictMode -Version 3.0
$hppFiles = Get-ChildItem -Path ..\include\*.hpp -Recurse
$cppFiles = Get-ChildItem -Path ..\src\*.cpp -Recurse
@@ -6,7 +8,7 @@ foreach ($hppFile in $hppFiles)
$cppFile = $hppFile -replace '\\include\\', '\src\'
$cppFile = $cppFile -replace '\.hpp', '.cpp'
$hasCpp = $cppFiles | Where-Object FullName -CEQ $cppFile
$hasCpp = @($cppFiles | Where-Object FullName -CEQ $cppFile)
if ($hasCpp.Count -gt 1)
{
throw 'More results for ' + $cppFile
@@ -16,7 +18,7 @@ foreach ($hppFile in $hppFiles)
continue
}
$containsExport = Select-String -Path $hppFile -Pattern 'SHAREDLIB_EXPORT'
$containsExport = @(Select-String -Path $hppFile -Pattern 'SHAREDLIB_EXPORT')
if ($containsExport.Count -eq 0)
{
continue