feat: Use DIR_ASSETS path to locate resource bundles (#47951)
* feat: Use DIR_ASSETS path to locate resource bundles Co-authored-by: Will Anderson <andersonw@dropbox.com> * Use DIR_ASSETS for calculating ASAR relative paths Co-authored-by: Will Anderson <andersonw@dropbox.com> * Add test to verify 'assets' matches parent dir of 'exe' Co-authored-by: Will Anderson <andersonw@dropbox.com> * Add Mac-specific test for assets path (but it is failing) Co-authored-by: Will Anderson <andersonw@dropbox.com> * test: Update app.getPath('assets') to expect an exception on Mac Co-authored-by: Will Anderson <andersonw@dropbox.com> * docs: Update docs for 'assets' path to indicate that it's only available on Windows + Linux Co-authored-by: Will Anderson <andersonw@dropbox.com> * fix: Don't define 'assets' mapping on macOS Co-authored-by: Will Anderson <andersonw@dropbox.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Will Anderson <andersonw@dropbox.com>
This commit is contained in:
parent
e83b0f6c23
commit
4f426daeca
6 changed files with 27 additions and 10 deletions
|
@ -382,6 +382,9 @@ int GetPathConstant(std::string_view name) {
|
|||
// clang-format off
|
||||
constexpr auto Lookup = base::MakeFixedFlatMap<std::string_view, int>({
|
||||
{"appData", DIR_APP_DATA},
|
||||
#if !BUILDFLAG(IS_MAC)
|
||||
{"assets", base::DIR_ASSETS},
|
||||
#endif
|
||||
#if BUILDFLAG(IS_POSIX)
|
||||
{"cache", base::DIR_CACHE},
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue