]> spindle.queued.net Git - midori/commitdiff
Add a --run switch to wscript, to run Midori after building
authorChristian Dywan <christian@twotoasts.de>
Fri, 12 Dec 2008 09:10:10 +0000 (10:10 +0100)
committerChristian Dywan <christian@twotoasts.de>
Fri, 12 Dec 2008 09:10:10 +0000 (10:10 +0100)
wscript

diff --git a/wscript b/wscript
index 441afc20ee26d23f775974e77cfa1ebf8cf6c913..51175f0c60da226d9fbe03f56824a0bebb7e7f2d 100644 (file)
--- a/wscript
+++ b/wscript
@@ -195,6 +195,8 @@ def set_options (opt):
 
     opt.tool_options ('compiler_cc')
     opt.tool_options ('intltool')
+    opt.add_option ('--run', action='store_true', default=False,
+        help='Run application after building it', dest='run')
 
     group = opt.add_option_group ('Directories', '')
     if (opt.parser.get_option ('--prefix')):
@@ -360,3 +362,12 @@ def shutdown ():
             Params.pprint ('RED', "Failed to generate po template.")
             Params.pprint ('RED', "Make sure intltool is installed.")
         os.chdir ('..')
+    elif Params.g_options.run:
+        folder = os.path.dirname (Params.g_build.env ()['waf_config_files'][0])
+        try:
+            application = subprocess.Popen ([
+                folder + os.sep + APPNAME + os.sep + APPNAME],
+                stderr=subprocess.PIPE)
+            application.wait ()
+        except:
+            Params.pprint ('RED', "Failed to run application.")