This commit is contained in:
Jeremie Dimino 2017-03-03 13:47:51 +00:00
parent 470d791bac
commit 65f06e7454
2 changed files with 9 additions and 1 deletions

View File

@ -110,9 +110,15 @@ module Mini_shexp = struct
module Unexpanded = struct
type t = (String_with_vars.t, String_with_vars.t) Ast.t
let t = Ast.t String_with_vars.t String_with_vars.t
let sexp_of_t = Ast.sexp_of_t String_with_vars.sexp_of_t String_with_vars.sexp_of_t
let t sexp =
match sexp with
| Atom _ ->
of_sexp_errorf sexp
"if you meant for this to be executed with bash, write (bash \"...\") instead"
| List _ -> Ast.t String_with_vars.t String_with_vars.t sexp
let fold_vars t ~init ~f =
Ast.fold t ~init ~f:(fun acc pat ->
String_with_vars.fold ~init:acc pat ~f)

View File

@ -241,6 +241,8 @@ module Gen(P : Params) = struct
List.map (Lib_db.resolve_selects t ~from:dir lib_deps) ~f:(fun { dst_fn; src_fn } ->
let src = Path.relative dir src_fn in
let dst = Path.relative dir dst_fn in
Build.path src
>>>
Build.action ~targets:[dst]
(Copy_and_add_line_directive (src, dst)))