Skip to content

Commit c7b9ce9

Browse files
Add soft-deleted resources option to Developer CLI
1 parent 7c53c07 commit c7b9ce9

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

shared/python/show_soft_deleted_resources.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44
"""
55

66
import sys
7+
import io
78
import argparse
89
from datetime import datetime
910
from pathlib import Path
1011

12+
# Configure UTF-8 encoding for console output
13+
if sys.stdout.encoding != 'utf-8':
14+
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
15+
1116
# APIM Samples imports
1217
import azure_resources as az
1318

start.ps1

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,12 @@ while ($true) {
116116
Write-Host " 1) Complete environment setup"
117117
Write-Host " 2) Verify local setup"
118118
Write-Host " 3) Show Azure account info"
119+
Write-Host " 4) Show soft-deleted resources"
119120
Write-Host ""
120121
Write-Host "Tests" -ForegroundColor Yellow
121-
Write-Host " 4) Run pylint"
122-
Write-Host " 5) Run tests"
123-
Write-Host " 6) Run full Python checks"
122+
Write-Host " 5) Run pylint"
123+
Write-Host " 6) Run tests"
124+
Write-Host " 7) Run full Python checks"
124125
Write-Host ""
125126
Write-Host "Misc" -ForegroundColor Yellow
126127
Write-Host " 0) Exit"
@@ -139,12 +140,15 @@ while ($true) {
139140
Invoke-Pause-Menu
140141
}
141142
'4' {
142-
if (Invoke-Cmd "$RepoRoot/tests/python/run_pylint.ps1") { Invoke-Pause-Menu }
143+
if (Invoke-Cmd (Get-Python) "$RepoRoot/shared/python/show_soft_deleted_resources.py") { Invoke-Pause-Menu }
143144
}
144145
'5' {
145-
if (Invoke-Cmd "$RepoRoot/tests/python/run_tests.ps1") { Invoke-Pause-Menu }
146+
if (Invoke-Cmd "$RepoRoot/tests/python/run_pylint.ps1") { Invoke-Pause-Menu }
146147
}
147148
'6' {
149+
if (Invoke-Cmd "$RepoRoot/tests/python/run_tests.ps1") { Invoke-Pause-Menu }
150+
}
151+
'7' {
148152
if (Invoke-Cmd "$RepoRoot/tests/python/check_python.ps1") { Invoke-Pause-Menu }
149153
}
150154
'0' {

start.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,12 @@ while true; do
7979
echo " 1) Complete environment setup"
8080
echo " 2) Verify local setup"
8181
echo " 3) Show Azure account info"
82+
echo " 4) Show soft-deleted resources"
8283
echo ""
8384
echo "Tests"
84-
echo " 4) Run pylint"
85-
echo " 5) Run tests"
86-
echo " 6) Run full Python checks"
85+
echo " 5) Run pylint"
86+
echo " 6) Run tests"
87+
echo " 7) Run full Python checks"
8788
echo ""
8889
echo "Misc"
8990
echo " 0) Exit"
@@ -102,14 +103,18 @@ while true; do
102103
if show_account; then pause_prompt; fi
103104
;;
104105
4)
105-
run_cmd "${REPO_ROOT}/tests/python/run_pylint.sh"
106+
run_cmd "$(find_python)" "${REPO_ROOT}/shared/python/show_soft_deleted_resources.py"
106107
pause_prompt
107108
;;
108109
5)
109-
run_cmd "${REPO_ROOT}/tests/python/run_tests.sh"
110+
run_cmd "${REPO_ROOT}/tests/python/run_pylint.sh"
110111
pause_prompt
111112
;;
112113
6)
114+
run_cmd "${REPO_ROOT}/tests/python/run_tests.sh"
115+
pause_prompt
116+
;;
117+
7)
113118
run_cmd "${REPO_ROOT}/tests/python/check_python.sh"
114119
pause_prompt
115120
;;

0 commit comments

Comments
 (0)