andreyorst / plug.kak

Plugin manager for Kakoune
MIT License
197 stars 18 forks source link

Wrong file order returned from find command #23

Closed andreyorst closed 6 years ago

andreyorst commented 6 years ago

With such structure of the plugin:

some_plugin.kak
└── rc
    ├── submodules
    │   └── module.kak
    └──  plugin.kak

find -type f -name "*.kak" will either print:

./rc/plugin.kak
./rc/submodules/module.kak

or:

./rc/submodules/module.kak
./rc/plugin.kak

Which is critical, since if module depends on some thing that is being declared in the main plugin, it will throw an error on source. Therefore plugin must be sourced first, then all subdirectories must be sourced after it. So I think something like breadth-first search is needed here, however GNU Find isn't capable to do such search.

andreyorst commented 6 years ago

should be fixed with the latest commits.