Very minor: Seems like this function could be defined in the parent scope, rather than once for each call of listPluginsInDirectory.