Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .githooks/pre-push → .githooks/pre-commit
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env sh
":" //; 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
":" //; 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
":" //; exit # Skip rest on Unix

@echo off
powershell -NoProfile -Command "if (Get-Command powershell -ErrorAction SilentlyContinue) { exit 0 } else { exit 1 }"
if %errorlevel% equ 0 (
powershell -ExecutionPolicy Bypass -File .githooks\pre-push.ps1
powershell -ExecutionPolicy Bypass -File .githooks\pre-commit.ps1
) else (
echo Error: PowerShell is not available. Please install PowerShell.
exit /b 1
Expand Down
3 changes: 1 addition & 2 deletions .githooks/pre-push.ps1 → .githooks/pre-commit.ps1
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $Modules = $ChangedFiles |
ForEach-Object { ($_ -split "/")[0] } | # Extract the moudule
Sort-Object -Unique # Ensure uniqueness

Write-Host "Verifying command models..." -ForegroundColor Green
Write-Host "Verifying command models...`n" -ForegroundColor Green

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is `n?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a new blank line.


# Get Git root directory
$GitRoot = git rev-parse --show-toplevel
Expand All @@ -20,7 +20,6 @@ $Modules | ForEach-Object {
Write-Host "Running: aaz-dev command-model verify -a $GitRoot -t $_" -ForegroundColor Yellow # For logging
aaz-dev command-model verify -a $GitRoot -t $_
if ($LASTEXITCODE -ne 0) {
Write-Host "Please pull the latest <Main> branch, and <Export> your command model again." -ForegroundColor Red
exit 1
}
}
Expand Down
3 changes: 1 addition & 2 deletions .githooks/pre-push.sh → .githooks/pre-commit.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Modules=$(echo "$ChangedFiles" |
cut -d '/' -f 1 | # Extract the module
sort -u) # Ensure uniqueness

echo "${GREEN}Verifying command models...${NC}"
echo -e "${GREEN}Verifying command models...${NC}\n"

# Get Git root directory
GitRoot=$(git rev-parse --show-toplevel)
Expand All @@ -26,7 +26,6 @@ for Module in $Modules; do
echo "${YELLOW}Running: aaz-dev command-model verify -a $GitRoot -t $Module${NC}" # For logging
aaz-dev command-model verify -a "$GitRoot" -t "$Module"
if [[ $? -ne 0 ]]; then
echo "${RED}Please pull the latest <Main> branch, and <Export> your command model again.${NC}"
exit 1
fi
done
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/verify-metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,3 @@ jobs:
- name: Verify data consistency
id: verification
run: aaz-dev command-model verify --aaz-path $GITHUB_WORKSPACE
continue-on-error: true

- name: Check on exception
if: steps.verification.outcome != 'success'
run: |
echo "Please pull the latest <main> branch, and <Export> your command model again."
exit 1