예제 #1
0
        public static async Task <ConsoleOutput> CreateMap(this MapOptions options, IWebHostEnvironment env)
        {
            var guid = Guid.NewGuid();

            options.Path    = $"{env.ContentRootPath}/wwwroot/mapping/";
            options.OutPath = $"{env.ContentRootPath}/wwwroot/mapping/{guid.ToString()}/";
            options.UnzipMap();

            var result = await options.CreateMap();

            if (!result.HasError)
            {
                result.Result = await File.ReadAllTextAsync($"{options.OutPath}{options.Data.Name}.json");
            }

            if (Directory.Exists(options.OutPath))
            {
                Directory.Delete(options.OutPath, true);
            }

            return(result);
        }