Skip to content

Commit

Permalink
pkg: support write-file in expander (#9720)
Browse files Browse the repository at this point in the history
Signed-off-by: Etienne Millon <me@emillon.org>
  • Loading branch information
emillon authored Jan 16, 2024
1 parent ae97208 commit cb1268d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/dune_rules/pkg_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,18 @@ module Action_expander = struct
>>= (function
| true -> expand action ~expander
| false -> Memo.return (Action.progn []))
| Write_file (path_sw, perm, contents_sw) ->
let+ path =
Expander.expand_pform_gen ~mode:Single expander path_sw
>>| Value.to_path ~dir
>>| Expander0.as_in_build_dir
~what:"write-file"
~loc:(String_with_vars.loc path_sw)
and+ contents =
Expander.expand_pform_gen ~mode:Single expander contents_sw
>>| Value.to_string ~dir
in
Action.Write_file (path, perm, contents)
| _ ->
Code_error.raise
"Pkg_rules.action_expander.expand: unsupported action"
Expand Down

0 comments on commit cb1268d

Please sign in to comment.