Skip to content

Commit

Permalink
Slightly better implementation of Build.action_dyn
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
  • Loading branch information
jeremiedimino committed Feb 6, 2019
1 parent 9beb943 commit 881295d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/build.ml
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,12 @@ let action ?dir ~targets action =
| Some dir -> Action.Chdir (dir, action)

let action_dyn ?dir ~targets () =
Targets targets
>>^ fun action ->
match dir with
| None -> action
| Some dir -> Action.Chdir (dir, action)
| None -> Targets targets
| Some dir ->
Targets targets
>>^ fun action ->
Action.Chdir (dir, action)

let write_file fn s =
action ~targets:[fn] (Write_file (fn, s))
Expand Down

0 comments on commit 881295d

Please sign in to comment.