I'm working with azure CLI to build out some automation around repo creation, etc. I'm using python as a sort of wrapper around various CLI commands to bundle up the automation. I want to write in a simple check to see if a repo name has been used and exists or not.
repoName comes from a system input and would be whatever the user wants to name their fresh repository.
So far I have this:
azRepoListCmd = "az repos list --query \"[?contains(name, \'" + repoName + "\')].[name]\" --organization https://myOrganizationHere.visualstudio.com/ --project myProject -o tsv"
azRepoList = os.system(azRepoListCmd)
print(azRepoList)
what the above returns is :
test-project-2
0
What is this "0" and where does it come from? Expected result would just be the name or an empty array if it didn't find anything.