File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -173,10 +173,20 @@ fn get_package_dir(package_name: &str, is_root: bool) -> String {
173
173
}
174
174
175
175
fn read_bsconfig ( package_dir : & str ) -> bsconfig:: T {
176
- if package_dir == "" {
177
- return bsconfig:: read ( "bsconfig.json" . to_string ( ) ) ;
176
+ let prefix = if package_dir == "" {
177
+ "" . to_string ( )
178
+ } else {
179
+ package_dir. to_string ( ) + "/"
180
+ } ;
181
+
182
+ let rescript_json_path = prefix. to_string ( ) + "rescript.json" ;
183
+ let bsconfig_json_path = prefix. to_string ( ) + "bsconfig.json" ;
184
+
185
+ if Path :: new ( & rescript_json_path) . exists ( ) {
186
+ bsconfig:: read ( rescript_json_path)
187
+ } else {
188
+ bsconfig:: read ( bsconfig_json_path)
178
189
}
179
- bsconfig:: read ( package_dir. to_string ( ) + "/bsconfig.json" )
180
190
}
181
191
182
192
/// # Make Package
You can’t perform that action at this time.
0 commit comments