Browse Source

use 4 spaces in new code (like in the rest of the file)

pull/557/head
Anton Firszov 8 years ago
parent
commit
d1bacad43e
  1. 66
      run-tests.ps1

66
run-tests.ps1

@ -16,26 +16,28 @@ function VerifyPath($path, $errorMessage) {
} }
function CheckSubmoduleStatus() { function CheckSubmoduleStatus() {
$submoduleStatus = (git submodule status) | Out-String $submoduleStatus = (git submodule status) | Out-String
# if the result string is empty, the command failed to run (we didn't capture the error stream) # if the result string is empty, the command failed to run (we didn't capture the error stream)
if ($submoduleStatus) { if ($submoduleStatus) {
# git has been called successfully, what about the status? # git has been called successfully, what about the status?
if (($submoduleStatus -match "\-") -or ($submoduleStatus -match "\(\(null\)\)")) if (($submoduleStatus -match "\-") -or ($submoduleStatus -match "\(\(null\)\)"))
{ {
# submodule has not been initialized! # submodule has not been initialized!
return 2; return 2;
} elseif ($submoduleStatus -match "\+") }
{ elseif ($submoduleStatus -match "\+")
# submodule is not synced: {
return 1; # submodule is not synced:
return 1;
}
else {
# everything fine:
return 0;
}
} else { } else {
# everything fine: # git call failed, so we should warn
return 0; return 3;
} }
} else {
# git call failed, so we should warn
return 3;
}
} }
@ -90,20 +92,20 @@ cd $PSScriptRoot
if (0 -ne ([int]$LASTEXITCODE)) { if (0 -ne ([int]$LASTEXITCODE)) {
# check submodule status # check submodule status
$submoduleStatus = CheckSubmoduleStatus $submoduleStatus = CheckSubmoduleStatus
if ([int]$submoduleStatus -eq 1) { if ([int]$submoduleStatus -eq 1) {
# not synced # not synced
Write-Host -ForegroundColor Yellow "Check if submodules are up to date. You can use 'git submodule update' to fix this"; Write-Host -ForegroundColor Yellow "Check if submodules are up to date. You can use 'git submodule update' to fix this";
} elseif ($submoduleStatus -eq 2) { } elseif ($submoduleStatus -eq 2) {
# not initialized # not initialized
Write-Host -ForegroundColor Yellow "Check if submodules are initialized. You can run 'git submodule init' to initialize them." Write-Host -ForegroundColor Yellow "Check if submodules are initialized. You can run 'git submodule init' to initialize them."
} elseif ($submoduleStatus -eq 3) { } elseif ($submoduleStatus -eq 3) {
# git not found, maybe submodules not synced? # git not found, maybe submodules not synced?
Write-Host -ForegroundColor Yellow "Could not check if submodules are initialized correctly. Maybe git is not installed?" Write-Host -ForegroundColor Yellow "Could not check if submodules are initialized correctly. Maybe git is not installed?"
} else { } else {
#Write-Host "Submodules are up to date"; #Write-Host "Submodules are up to date";
} }
} }
exit $LASTEXITCODE exit $LASTEXITCODE

Loading…
Cancel
Save