metrumresearchgroup / bbr

R interface for model and project management
https://metrumresearchgroup.github.io/bbr/
Other
23 stars 2 forks source link

windows: use_bbi issues #576

Closed kyleam closed 1 year ago

kyleam commented 1 year ago

Two problems were encountered using use_bbi on Windows:

  1. no bbi reported as being installed despite use_bbi downloading it

  2. the "please either set..." message being shown despite that being set

The first one looks to be because Sys.which will come up empty on Windows unless the path ends with ".exe". When on Windows, we might want to check that the binary path ends with ".exe", but we should at least change build_bbi_install_path so that it tacks on ".exe":

https://github.com/metrumresearchgroup/bbr/blob/d4453a98a63051b76dcc20380e69646a1acd9177/R/use-bbi.R#L224-L227

Note also that there is already this:

https://github.com/metrumresearchgroup/bbr/blob/d4453a98a63051b76dcc20380e69646a1acd9177/R/aaa.R#L1-L5

The second issue is because install_menu uses normalizePath, and add_to_path_message compares that value to bbr.bbi_exe_path. normalizePath by default converts "/" to "\", so the bbi_exe_path value needs to use the same form. (Note that file.path on windows uses "/" by default.) This fix here is probably to make add_to_path_message feed bbr.bbi_exe_path to normalizePath before comparing.