public function checkModuleExists($dirname)
    {
        // Mysite is base-only and doesn't need _config.php to be counted
        if (in_array($dirname, ['mysite', 'app'])) {
            return file_exists($this->getBaseDir() . $dirname);
        }

        $paths = [
            "vendor/silverstripe/{$dirname}/",
            "{$dirname}/",
        ];
        foreach ($paths as $path) {
            $checks = ['_config', '_config.php'];
            foreach ($checks as $check) {
                if (file_exists($this->getBaseDir() . $path . $check)) {
                    return true;
                }
            }
        }

        return false;
    }