For such a project, I think a different structure would make more sense. A structure where each supported package manager is a module on its own (like module/pacman.sh) and contains all the logic for this specific package manager. Those modules would only contain functions. And the main script with the main logic and loads in the module would not know or check what package manager it uses, but instead just runs the functions that are named the same in each module. But that would obviously require a major rewrite.
Makes sense and you’re probably right, but I’ll tell you why I didn’t do it that way:
I just did what came first to me
I like the idea of the API defining the project structure
When adding a new package manager, if that ever happens, I would like to see all other implementation of the same functionality on the same file, for help and inspiration
For such a project, I think a different structure would make more sense. A structure where each supported package manager is a module on its own (like module/pacman.sh) and contains all the logic for this specific package manager. Those modules would only contain functions. And the main script with the main logic and loads in the module would not know or check what package manager it uses, but instead just runs the functions that are named the same in each module. But that would obviously require a major rewrite.
Makes sense and you’re probably right, but I’ll tell you why I didn’t do it that way: