private void CleanOutputPath()

in src/Microsoft.NET.Sdk.Functions.Generator/FunctionJsonConverter.cs [327:346]


        private void CleanOutputPath()
        {
            Directory.GetDirectories(_outputPath)
                .Select(d => Path.Combine(d, "function.json"))
                .Where(File.Exists)
                .Select(Path.GetDirectoryName)
                .Where(d => !_excludedFunctionNames.Contains(new DirectoryInfo(d).Name))
                .ToList()
                .ForEach(directory =>
                {
                    try
                    {
                        Directory.Delete(directory, recursive: true);
                    }
                    catch
                    {
                        _logger.LogWarning($"Unable to clean directory {directory}.");
                    }
                });
        }