-
Notifications
You must be signed in to change notification settings - Fork 3.4k
{Packaging} Fix cask template and az upgrade for preview and homebrew-cask migration
#33168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
8430287
8a27541
4a2a6f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -132,9 +132,24 @@ def upgrade_version(cmd, update_all=None, yes=None, allow_preview=None): # pyli | |
| exit_code = subprocess.call(update_cmd) | ||
| elif installer == 'HOMEBREW_CASK': | ||
| logger.debug("Update homebrew cask") | ||
| # Determine cask token: 'azure-cli-preview' (custom tap) or 'azure-cli' (homebrew-cask) | ||
| try: | ||
| preview_installed = subprocess.call(['brew', 'list', '--cask', 'azure-cli-preview'], | ||
| stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) == 0 | ||
| cli_installed = subprocess.call(['brew', 'list', '--cask', 'azure-cli'], | ||
| stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) == 0 | ||
| if preview_installed: | ||
| cask_token = 'azure-cli-preview' | ||
| elif cli_installed: | ||
| cask_token = 'azure-cli' | ||
| else: | ||
| raise CLIError(UPGRADE_MSG) | ||
| except OSError as ex: | ||
| logger.debug("Failed to detect Homebrew cask token: %s", ex) | ||
| cask_token = 'azure-cli' | ||
| exit_code = subprocess.call(['brew', 'update']) | ||
| if exit_code == 0: | ||
| update_cmd = ['brew', 'upgrade', '--cask', 'azure-cli'] | ||
| update_cmd = ['brew', 'upgrade', '--cask', cask_token] | ||
| logger.debug("Update azure cli with '%s'", " ".join(update_cmd)) | ||
| exit_code = subprocess.call(update_cmd) | ||
|
Comment on lines
+135
to
154
|
||
| elif installer == 'PIP': | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.