File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -114,13 +114,15 @@ let rec find_dep_path ic package_name =
114
114
|> Ext_string. split_by (fun c -> c = '"' )
115
115
|> List. hd
116
116
else
117
- find_dep_path ic package_name
117
+ find_dep_path ic package_name
118
118
119
119
let get_dep_path_from_file ~cwd package =
120
120
(* We should find the correct file if we move 3 steps up because we're in _esy/<sandbox>/store/b/<build> *)
121
- let ic = open_in_bin Ext_path. (cwd // " .." // " .." // " .." // " installation.json" ) in
122
- let package_name = Bsb_pkg_types. to_string package in
123
- find_dep_path ic package_name
121
+ try
122
+ let ic = open_in_bin Ext_path. (cwd // " .." // " .." // " .." // " installation.json" ) in
123
+ let package_name = Bsb_pkg_types. to_string package in
124
+ Some (find_dep_path ic package_name)
125
+ with _ -> None
124
126
125
127
(* * TODO: collect all warnings and print later *)
126
128
let resolve_bs_package ~cwd (package : t ) =
@@ -137,8 +139,9 @@ let resolve_bs_package ~cwd (package : t) =
137
139
(Bsb_pkg_types. to_string package)
138
140
custom_pkg_loc;
139
141
140
- try get_dep_path_from_file ~cwd package
141
- with _ -> Bsb_exception. package_not_found ~pkg: package ~json: None
142
+ match get_dep_path_from_file ~cwd package with
143
+ | Some dep_path -> dep_path
144
+ | None -> Bsb_exception. package_not_found ~pkg: package ~json: None
142
145
end
143
146
| path when not (Sys. file_exists path) ->
144
147
begin
You can’t perform that action at this time.
0 commit comments