The unified diff between revisions [f9bf0ab9..] and [23b40306..] is displayed below. It can also be downloaded as a raw diff.

This diff has been restricted to the following files: 'subprocess.ml'

#
#
# patch "subprocess.ml"
#  from [e047bb5bcd5ea674256397d3f8ea0b5c2ce3f919]
#    to [108e578184541d73e6e98b98624c5bdaf4de0134]
#
============================================================
--- subprocess.ml	e047bb5bcd5ea674256397d3f8ea0b5c2ce3f919
+++ subprocess.ml	108e578184541d73e6e98b98624c5bdaf4de0134
@@ -131,7 +131,7 @@ type t = {
     mutable status  : int ;
   }

-let spawn encoding input_opt cmd reap_callback done_callback =
+let spawn ?working_directory encoding input_opt cmd reap_callback done_callback =
   let has_input = input_opt <> None in
   let spawn_flags =
     [ `PIPE_STDOUT ; `PIPE_STDERR ;
@@ -139,7 +139,8 @@ let spawn encoding input_opt cmd reap_ca

   let child_info =
     Gspawn.async_with_pipes
-      (if has_input then `PIPE_STDIN :: spawn_flags else spawn_flags)
+      ?working_directory
+      ~flags:(if has_input then `PIPE_STDIN :: spawn_flags else spawn_flags)
       cmd in

   let state = { watches = [] ; aborted = false ; status = -1 } in
@@ -205,11 +206,11 @@ type callback =
   int -> unit

 (* spawn a process and grab its stdout and stderr *)
-let spawn_out ~encoding ~cmd ~reap_callback done_callback =
+let spawn_out ?working_directory ~encoding ~cmd ~reap_callback done_callback =
   spawn encoding None cmd reap_callback done_callback

 (* spawn a process, feed it a string and grab its stdout and stderr *)
-let spawn_inout ~encoding ~cmd ~input ~reap_callback done_callback =
+let spawn_inout ?working_directory ~encoding ~cmd ~input ~reap_callback done_callback =
   spawn encoding (Some input) cmd reap_callback done_callback

 let abort sub_data =