dotnet-installer/src/Microsoft.DotNet.Tools.Compiler.Native/DirectoryExtensions.cs

35 lines
924 B
C#
Raw Normal View History

2015-11-17 20:16:10 -08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using System.IO;
using Microsoft.Dnx.Runtime.Common.CommandLine;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.Tools.Common;
namespace Microsoft.DotNet.Tools.Compiler.Native
{
public static class DirectoryExtensions
{
internal static void CleanOrCreateDirectory(string path)
{
if (Directory.Exists(path))
{
try
{
Directory.Delete(path, recursive: true);
Directory.CreateDirectory(path);
}
catch (Exception e)
{
Console.WriteLine("Unable to remove directory: " + path);
Console.WriteLine(e.Message);
}
}
}
}
}