Skip to content

Commit

Permalink
mltools: Separate rm -rf command from parameters
Browse files Browse the repository at this point in the history
Add "--" to avoid any problems if the directory name starts with a "-"
in some scenario.

Suggested-by: Laszlo Ersek
  • Loading branch information
rwmjones committed Jul 15, 2022
1 parent f92b8b2 commit fd964c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mltools/on_exit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ let do_actions () =
List.iter (do_action (fun file -> Unix.unlink file)) !files;
List.iter (do_action (
fun dir ->
let cmd = sprintf "rm -rf %s" (Filename.quote dir) in
let cmd = sprintf "rm -rf -- %s" (Filename.quote dir) in
ignore (Tools_utils.shell_command cmd)
)
) !rmdirs;
Expand Down

0 comments on commit fd964c1

Please sign in to comment.