Skip to content

Commit fa0b5a6

Browse files
committed
Fix the incorrect error message when azcopy cannot find the installation location
1 parent 2989946 commit fa0b5a6

File tree

1 file changed

+6
-2
lines changed
  • src/azure-cli/azure/cli/command_modules/storage/azcopy

1 file changed

+6
-2
lines changed

src/azure-cli/azure/cli/command_modules/storage/azcopy/util.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,16 @@ def _get_default_install_location():
178178
if system == 'Windows':
179179
home_dir = os.environ.get('USERPROFILE')
180180
if not home_dir:
181-
return None
181+
raise CLIError('In the Windows platform, please specify the environment variable "USERPROFILE" '
182+
'as the installation location.')
182183
install_location = os.path.join(home_dir, r'.azcopy\azcopy.exe')
183184
elif system in ('Linux', 'Darwin'):
184185
install_location = os.path.expanduser(os.path.join('~', 'bin/azcopy'))
185186
else:
186-
install_location = None
187+
raise CLIError('The {} platform is not currently supported. '
188+
'If you want to know which platforms are supported, please refer to the document '
189+
'https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10#download-azcopy'
190+
.format(system))
187191
return install_location
188192

189193

0 commit comments

Comments
 (0)