feat: Use DIR_ASSETS path to locate resource bundles (#47439)

* feat: Use DIR_ASSETS path to locate resource bundles

* Use DIR_ASSETS for calculating ASAR relative paths

* Add test to verify 'assets' matches parent dir of 'exe'

* Add Mac-specific test for assets path (but it is failing)

* test: Update app.getPath('assets') to expect an exception on Mac

* docs: Update docs for 'assets' path to indicate that it's only available on Windows + Linux

* fix: Don't define 'assets' mapping on macOS
This commit is contained in:
Will Anderson 2025-08-03 20:34:08 -07:00 committed by GitHub
commit e7683bdd25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 27 additions and 10 deletions

View file

@ -383,6 +383,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