j0k3r / graby-site-config

Graby site config files
Other
18 stars 29 forks source link

[BUG] Finder->sortByName breaks custom overwrites #51

Closed mutschler closed 1 year ago

mutschler commented 1 year ago

Found files are currently sorted by name (https://github.com/j0k3r/graby-site-config/blob/master/src/Files.php#L24) that kind of prevents you from overwriting config files which are provided with cusom ones.

Example:

Assume we have the following structure (and example.com would exist in this repository as well):

site_config
  default
    example.com
  custom
    example.com
$files = Files::getFiles(['site_config/default', 'site_config/custom'])

i would assume - based on the order of folders i submitted to getFiles - that site_config/custom/example.com is used, but instead (because of sorting) vendor/j0k3r/graby-site-config/example.com would be used.

by just getting rid of the sorting (which imho isn't needed anyway) the files would be returned correctly

j0k3r commented 1 year ago

Looks interesting and legit as far as I know. Feel free to submit a PR to remove it :)

mutschler commented 1 year ago

Done :)