summaryrefslogtreecommitdiffstats
path: root/febootstrap_utils.ml
diff options
context:
space:
mode:
Diffstat (limited to 'febootstrap_utils.ml')
-rw-r--r--febootstrap_utils.ml12
1 files changed, 8 insertions, 4 deletions
diff --git a/febootstrap_utils.ml b/febootstrap_utils.ml
index 04c91ad..2265753 100644
--- a/febootstrap_utils.ml
+++ b/febootstrap_utils.ml
@@ -90,10 +90,14 @@ let tmpdir () =
*)
let tmpdir = Filename.temp_dir_name // sprintf "febootstrap%s.tmp" data in
Unix.mkdir tmpdir 0o700;
- at_exit
- (fun () ->
- let cmd = sprintf "rm -rf %s" (Filename.quote tmpdir) in
- ignore (Sys.command cmd));
+
+ (* Only remove the directory if --save-temps was *not* specified. *)
+ if not Febootstrap_cmdline.save_temps then
+ at_exit
+ (fun () ->
+ let cmd = sprintf "rm -rf %s" (Filename.quote tmpdir) in
+ ignore (Sys.command cmd));
+
tmpdir
let rec find s sub =