File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /usr/bin/env sh
2- " :" //; if command -v pwsh > /dev/null 2>&1 ; then pwsh -ExecutionPolicy Bypass -File .githooks/pre-push .ps1; else sh .githooks/pre-push .sh; fi ; exit $? # Try PowerShell Core first, then sh on Unix
2+ " :" //; if command -v pwsh > /dev/null 2>&1 ; then pwsh -ExecutionPolicy Bypass -File .githooks/pre-commit .ps1; else sh .githooks/pre-commit .sh; fi ; exit $? # Try PowerShell Core first, then sh on Unix
33" :" //; exit # Skip rest on Unix
44
55@echo off
66powershell -NoProfile -Command " if (Get-Command powershell -ErrorAction SilentlyContinue) { exit 0 } else { exit 1 }"
77if %errorlevel% equ 0 (
8- powershell -ExecutionPolicy Bypass -File .githooks\p re-push .ps1
8+ powershell -ExecutionPolicy Bypass -File .githooks\p re-commit .ps1
99) else (
1010 echo Error: PowerShell is not available. Please install PowerShell.
1111 exit /b 1
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ $Modules = $ChangedFiles |
1010 ForEach-Object { ($_ -split " /" )[0 ] } | # Extract the moudule
1111 Sort-Object - Unique # Ensure uniqueness
1212
13- Write-Host " Verifying command models..." - ForegroundColor Green
13+ Write-Host " Verifying command models...`n " - ForegroundColor Green
1414
1515# Get Git root directory
1616$GitRoot = git rev- parse -- show-toplevel
@@ -20,7 +20,6 @@ $Modules | ForEach-Object {
2020 Write-Host " Running: aaz-dev command-model verify -a $GitRoot -t $_ " - ForegroundColor Yellow # For logging
2121 aaz- dev command- model verify - a $GitRoot - t $_
2222 if ($LASTEXITCODE -ne 0 ) {
23- Write-Host " Please pull the latest <Main> branch, and <Export> your command model again." - ForegroundColor Red
2423 exit 1
2524 }
2625}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ Modules=$(echo "$ChangedFiles" |
1616 cut -d ' /' -f 1 | # Extract the module
1717 sort -u) # Ensure uniqueness
1818
19- echo " ${GREEN} Verifying command models...${NC} "
19+ echo -e " ${GREEN} Verifying command models...${NC} \n "
2020
2121# Get Git root directory
2222GitRoot=$( git rev-parse --show-toplevel)
@@ -26,7 +26,6 @@ for Module in $Modules; do
2626 echo " ${YELLOW} Running: aaz-dev command-model verify -a $GitRoot -t $Module ${NC} " # For logging
2727 aaz-dev command-model verify -a " $GitRoot " -t " $Module "
2828 if [[ $? -ne 0 ]]; then
29- echo " ${RED} Please pull the latest <Main> branch, and <Export> your command model again.${NC} "
3029 exit 1
3130 fi
3231done
Original file line number Diff line number Diff line change 2828 - name : Verify data consistency
2929 id : verification
3030 run : aaz-dev command-model verify --aaz-path $GITHUB_WORKSPACE
31- continue-on-error : true
32-
33- - name : Check on exception
34- if : steps.verification.outcome != 'success'
35- run : |
36- echo "Please pull the latest <main> branch, and <Export> your command model again."
37- exit 1
You can’t perform that action at this time.
0 commit comments