Skip to content

Commit

Permalink
fix src and tgt
Browse files Browse the repository at this point in the history
  • Loading branch information
kairu-ms committed Nov 11, 2024
1 parent 0a2f946 commit fbb636f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .githooks/pre-push.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ $currentBranch = git branch --show-current

# Run command azdev lint
Write-Host "Running azdev lint..." -ForegroundColor Green
azdev linter --repo ./ --tgt $currentBranch --src upstream/dev
azdev linter --repo ./ --src $currentBranch --tgt upstream/dev
if ($LASTEXITCODE -ne 0) {
Write-Host "Error: azdev lint check failed." -ForegroundColor Red
exit 1
}

# Run command azdev style
Write-Host "Running azdev style..." -ForegroundColor Green
azdev style --repo ./ --tgt $currentBranch --src upstream/dev
azdev style --repo ./ --src $currentBranch --tgt upstream/dev
if ($LASTEXITCODE -ne 0) {
$error_msg = azdev style --repo ./ --tgt $currentBranch --src upstream/dev 2>&1
$error_msg = azdev style --repo ./ --src $currentBranch --tgt upstream/dev 2>&1
if ($error_msg -like "*No modules*") {
Write-Host "Pre-push hook passed." -ForegroundColor Green
exit 0
Expand All @@ -41,7 +41,7 @@ if ($LASTEXITCODE -ne 0) {

# Run command azdev test
Write-Host "Running azdev test..." -ForegroundColor Green
azdev test --repo ./ --tgt $currentBranch --src upstream/dev
azdev test --repo ./ --src $currentBranch --tgt upstream/dev
if ($LASTEXITCODE -ne 0) {
Write-Host "Error: azdev test check failed." -ForegroundColor Red
exit 1
Expand Down
8 changes: 4 additions & 4 deletions .githooks/pre-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ currentBranch=$(git branch --show-current)

# Run command azdev lint
echo "\033[0;32mRunning azdev lint...\033[0m"
azdev linter --repo ./ --tgt $currentBranch --src upstream/dev
azdev linter --repo ./ --src $currentBranch --tgt upstream/dev
if [ $? -ne 0 ]; then
echo "\033[0;31mError: azdev lint check failed.\033[0m"
exit 1
fi

# Run command azdev style
echo "\033[0;32mRunning azdev style...\033[0m"
azdev style --repo ./ --tgt $currentBranch --src upstream/dev
azdev style --repo ./ --src $currentBranch --tgt upstream/dev
if [ $? -ne 0 ]; then
error_msg=$(azdev style --repo ./ --tgt $currentBranch --src upstream/dev 2>&1)
error_msg=$(azdev style --repo ./ --src $currentBranch --tgt upstream/dev 2>&1)
if echo "$error_msg" | grep -q "No modules"; then
echo "\033[0;32mPre-push hook passed.\033[0m"
exit 0
Expand All @@ -43,7 +43,7 @@ fi

# Run command azdev test
echo "\033[0;32mRunning azdev test...\033[0m"
azdev test --repo ./ --tgt $currentBranch --src upstream/dev
azdev test --repo ./ --src $currentBranch --tgt upstream/dev
if [ $? -ne 0 ]; then
echo "\033[0;31mError: azdev test check failed.\033[0m"
exit 1
Expand Down

0 comments on commit fbb636f

Please sign in to comment.