summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2022-11-15 07:25:35 +0530
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2022-11-18 19:39:12 +0000
commit80baa8b5aca9f1de996007b92f6b6b3e42e6f877 (patch)
treeb3b6505c549b2dacb2c9a666a66a78a30660a419
parent56263fb189a77e0419e252da9fecda3752c7287f (diff)
cerbero: Return an error when download fails on powershell
The &{ } construct we were using for chaining commands actually eats the exit code of the last command. Turns out we don't actually need that construct at all to chain commands. Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/1020>
-rw-r--r--cerbero/utils/shell.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cerbero/utils/shell.py b/cerbero/utils/shell.py
index 1e9260ad..995ae759 100644
--- a/cerbero/utils/shell.py
+++ b/cerbero/utils/shell.py
@@ -387,10 +387,10 @@ async def download(url, dest, check_cert=True, overwrite=False, logfile=None, mi
urls += [urllib.parse.urljoin(u + '/', filename) for u in mirrors]
if sys.platform.startswith('win'):
- cmd = ['powershell', '-Command', '& { Set-Variable -Name ' \
+ cmd = ['powershell', '-Command', 'Set-Variable -Name ' \
'ProgressPreference -Value \'SilentlyContinue\'; ' \
f'Invoke-WebRequest -UserAgent {user_agent} -OutFile {dest} ' \
- '-Method Get -Uri %s }']
+ '-Method Get -Uri %s']
elif which('wget'):
cmd = ['wget', '--user-agent', user_agent, '--tries=2', '--timeout=20',
'--progress=dot:giga', '-O', dest]