Blob Blame History Raw
From 32e3128c47635739baed38354c47a54c86ea62d0 Mon Sep 17 00:00:00 2001
From: Aaron Meurer <asmeurer@gmail.com>
Date: Sun, 9 Feb 2014 15:17:42 -0600
Subject: [PATCH 10/14] Preserve exit status

Previously, webassets would always give exit status 1, which makes things that
use it think that it is failing.

(cherry picked from commit 17438b922f957bff370478075798b566c7d71612)

diff --git a/src/webassets/script.py b/src/webassets/script.py
index 13f8753..24c5f93 100644
--- a/src/webassets/script.py
+++ b/src/webassets/script.py
@@ -540,10 +540,10 @@ class GenericArgparseImplementation(object):
     def run_with_argv(self, argv):
         try:
             ns = self.parser.parse_args(argv)
-        except SystemExit:
+        except SystemExit as e:
             # We do not want the main() function to exit the program.
             # See run() instead.
-            return 1
+            return e.args[0]
 
         return self.run_with_ns(ns)
 
-- 
1.9.3