diff --git a/.ocamlformat b/.ocamlformat index 1f3888a..187e7df 100644 --- a/.ocamlformat +++ b/.ocamlformat @@ -1 +1 @@ -version=0.28.1 +version=0.29.0 diff --git a/merry.opam b/merry.opam index 96beb4d..4946ecd 100644 --- a/merry.opam +++ b/merry.opam @@ -48,7 +48,5 @@ dev-repo: "git+https://tangled.org/patrick.sirref.org/merry" x-maintenance-intent: ["(latest)"] pin-depends:[ # Needed for setpgid - [ "eio.1.4" "git+https://github.com/ocaml-multicore/eio#d9ae0c2e4f9fda9fc5727ef5f23e473c3984ec35" ] - [ "eio_posix.1.4" "git+https://github.com/ocaml-multicore/eio#d9ae0c2e4f9fda9fc5727ef5f23e473c3984ec35" ] [ "glob.dev" "git+https://git.sirref.org/glob#c1856d8bcc69a7b2d0e567dd3e7b4f0318db3f03" ] ] diff --git a/merry.opam.template b/merry.opam.template index 32d25f8..a6ff888 100644 --- a/merry.opam.template +++ b/merry.opam.template @@ -1,6 +1,4 @@ pin-depends:[ # Needed for setpgid - [ "eio.1.4" "git+https://github.com/ocaml-multicore/eio#d9ae0c2e4f9fda9fc5727ef5f23e473c3984ec35" ] - [ "eio_posix.1.4" "git+https://github.com/ocaml-multicore/eio#d9ae0c2e4f9fda9fc5727ef5f23e473c3984ec35" ] [ "glob.dev" "git+https://git.sirref.org/glob#c1856d8bcc69a7b2d0e567dd3e7b4f0318db3f03" ] ] diff --git a/src/lib/eval.ml b/src/lib/eval.ml index 716d6c3..992de20 100644 --- a/src/lib/eval.ml +++ b/src/lib/eval.ml @@ -781,8 +781,8 @@ module Make (S : Types.State) (E : Types.Exec) = struct loop pctx job rest | _ -> ( let ctx, exec_and_args = - if is_command then begin - match command_args with + if is_command then + begin match command_args with | [] -> assert false | x :: xs -> ( let hash, prog = @@ -801,7 +801,7 @@ module Make (S : Types.State) (E : Types.Exec) = struct Exit.zero ("echo", [ prog ]) ) else (ctx, Exit.zero (x, xs))) - end + end else (ctx, Exit.zero (executable, args)) in match exec_and_args with @@ -1491,10 +1491,10 @@ module Make (S : Types.State) (E : Types.Exec) = struct let v, ls = String.fold_left (fun (so_far, ls) c -> - if String.contains ifs c then begin - if has_ws ifs && String.(equal so_far empty) then ("", ls) + if String.contains ifs c then + begin if has_ws ifs && String.(equal so_far empty) then ("", ls) else ("", so_far :: ls) - end + end else (so_far ^ String.make 1 c, ls)) ("", []) s in @@ -1628,12 +1628,12 @@ module Make (S : Types.State) (E : Types.Exec) = struct match ctx with Exit.Zero ctx -> read_arg ctx w | _ -> ctx) (Exit.zero ctx) assignments | fs, _assignments -> - if List.mem ~compare:String.compare "p" fs then begin - match kind with + if List.mem ~compare:String.compare "p" fs then + begin match kind with | `Readonly -> S.pp_readonly Fmt.stdout ctx.state | `Export -> S.pp_export Fmt.stdout ctx.state | `Local -> () - end; + end; Exit.zero ctx and expand_redirects ((ctx, acc) : ctx * Ast.cmd_suffix_item list) @@ -1809,12 +1809,12 @@ module Make (S : Types.State) (E : Types.Exec) = struct Ast.Fragment.join_list ~sep:"" (List.concat pattern) in - if Glob.test ~pattern scrutinee then begin - match sub with + if Glob.test ~pattern scrutinee then + begin match sub with | Some (c, sep) -> Some (exec ctx (c, Some sep)) | None -> Some (Exit.zero ctx) - end + end else inner_acc) None p)) None case_list