internal static int Process(Options options) { var targetPath = Path.Combine(options.OutputDirectory ?? ".", options.ProjectName); if (Directory.Exists(targetPath) == false) { Directory.CreateDirectory(targetPath); } var templateZip = (string)null; if (string.IsNullOrEmpty(options.TemplatePath)) { templateZip = Path.ChangeExtension(Assembly.GetEntryAssembly().Location, "zip"); } else if (File.Exists(options.TemplatePath)) { templateZip = options.TemplatePath; } var srcPath = options.TemplatePath; if (string.IsNullOrEmpty(templateZip) == false) { srcPath = PackageUtil.CreateTemporaryDirectory(); ZipFile.ExtractToDirectory(templateZip, srcPath); } Console.WriteLine("* BuildGuidMappingTable"); BuildGuidMappingTable(options, srcPath); Console.WriteLine("* Populate"); Populate(options, srcPath, targetPath); if (string.IsNullOrEmpty(templateZip) == false) { Directory.Delete(srcPath, true); } Console.WriteLine("* RestorePackage"); RestorePackages(options, targetPath); return(0); }