Fix $configFile to handle both files and dirs