Skip to content

Commit 94feb80

Browse files
committed
tweaks
1 parent 26bcb7d commit 94feb80

File tree

2 files changed

+26
-22
lines changed

2 files changed

+26
-22
lines changed

jscomp/bin/bsb.ml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10164,6 +10164,18 @@ let rec process_theme_aux env cwd (x : OCamlRes.Res.node) =
1016410164
Unix.mkdir (cwd//current) 0o777;
1016510165
List.iter (fun x -> process_theme_aux env (cwd//current) x ) nodes
1016610166

10167+
let list_themes () =
10168+
Format.fprintf Format.std_formatter "Available themes: @.";
10169+
Bsb_templates.root
10170+
|>
10171+
List.iter (fun (x : OCamlRes.Res.node) ->
10172+
match x with
10173+
| Dir (x, _) ->
10174+
Format.fprintf Format.std_formatter "%s@." x
10175+
10176+
| _ -> ()
10177+
)
10178+
1016710179
(* @raise [Not_found] *)
1016810180
let process_themes name theme proj_dir (themes : OCamlRes.Res.node list ) =
1016910181
let env = String_hashtbl.create 0 in
@@ -10179,6 +10191,7 @@ let process_themes name theme proj_dir (themes : OCamlRes.Res.node list ) =
1017910191
| File _ -> false
1018010192
) themes with
1018110193
| exception Not_found ->
10194+
list_themes ();
1018210195
raise (Arg.Bad( "theme " ^ name ^ " not found") )
1018310196
| Dir(_theme, nodes ) ->
1018410197
List.iter (fun node -> process_theme_aux env proj_dir node ) nodes
@@ -10211,17 +10224,6 @@ let init_sample_project ~cwd ~theme name =
1021110224
end
1021210225

1021310226

10214-
let list_themes () =
10215-
Format.fprintf Format.std_formatter "Available themes: @.";
10216-
Bsb_templates.root
10217-
|>
10218-
List.iter (fun (x : OCamlRes.Res.node) ->
10219-
match x with
10220-
| Dir (x, _) ->
10221-
Format.fprintf Format.std_formatter "%s@." x
10222-
10223-
| _ -> ()
10224-
)
1022510227

1022610228
end
1022710229
module Bsb_unix : sig

jscomp/bsb/bsb_init.ml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ let rec process_theme_aux env cwd (x : OCamlRes.Res.node) =
5959
Unix.mkdir (cwd//current) 0o777;
6060
List.iter (fun x -> process_theme_aux env (cwd//current) x ) nodes
6161

62+
let list_themes () =
63+
Format.fprintf Format.std_formatter "Available themes: @.";
64+
Bsb_templates.root
65+
|>
66+
List.iter (fun (x : OCamlRes.Res.node) ->
67+
match x with
68+
| Dir (x, _) ->
69+
Format.fprintf Format.std_formatter "%s@." x
70+
71+
| _ -> ()
72+
)
73+
6274
(* @raise [Not_found] *)
6375
let process_themes name theme proj_dir (themes : OCamlRes.Res.node list ) =
6476
let env = String_hashtbl.create 0 in
@@ -74,6 +86,7 @@ let process_themes name theme proj_dir (themes : OCamlRes.Res.node list ) =
7486
| File _ -> false
7587
) themes with
7688
| exception Not_found ->
89+
list_themes ();
7790
raise (Arg.Bad( "theme " ^ name ^ " not found") )
7891
| Dir(_theme, nodes ) ->
7992
List.iter (fun node -> process_theme_aux env proj_dir node ) nodes
@@ -106,14 +119,3 @@ let init_sample_project ~cwd ~theme name =
106119
end
107120

108121

109-
let list_themes () =
110-
Format.fprintf Format.std_formatter "Available themes: @.";
111-
Bsb_templates.root
112-
|>
113-
List.iter (fun (x : OCamlRes.Res.node) ->
114-
match x with
115-
| Dir (x, _) ->
116-
Format.fprintf Format.std_formatter "%s@." x
117-
118-
| _ -> ()
119-
)

0 commit comments

Comments
 (0)