From 2d364be7d8101ac615bf9f9cc13feccce1a9ae5c Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Wed, 19 Oct 2016 10:09:52 +0300 Subject: Throw exception in install failure --- mowgli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mowgli.py b/mowgli.py index 5cd4e91..c1b2dd3 100755 --- a/mowgli.py +++ b/mowgli.py @@ -128,7 +128,10 @@ def download(url): def install(pkg): - subprocess.call(['/usr/sbin/installer', '-pkg', pkg, '-target', '/']) + r = subprocess.call(['/usr/sbin/installer', '-pkg', pkg, '-target', '/']) + if r > 0: + raise Exception('Failed to install package %s' % pkg) + os.remove(pkg) -- cgit v1.2.3