public static int Package(PackageOptions options, TextWriter output, TextWriter error) { #pragma warning disable VSTHRD002 // Ignoring as this is only a helper tool, that is called from console var action = InferPackageAction(options); switch (action) { case PackageTask.Create: PackageWorker.CreateAsync(options.CreateNew, options.OutFile, options.CertThumbprint, output, error).Wait(); break; case PackageTask.Extract: PackageWorker.ExtractAsync(options.Extract, options.DestionationDir, output, error).Wait(); break; case PackageTask.Info: PackageWorker.GetInfo(options.Info, output, error); break; case PackageTask.Prepare: PackageWorker.Prepare(options.PrepareDir, options.Exclusions, options.Version, options.Verbose, output, error); break; default: error.WriteLine($"Unexpected action '{action.ToString()}'"); return(1); } return(0); #pragma warning restore VSTHRD002 // Avoid problematic synchronous waits }
public static int Package(PackageOptions options, TextWriter output, TextWriter error) { var action = InferPackageAction(options); switch (action) { case PackageTask.Create: PackageWorker.Create(options.CreateNew, options.OutFile, options.CertThumbprint, output, error); break; case PackageTask.Extract: PackageWorker.Extract(options.Extract, options.DestionationDir, output, error); break; case PackageTask.Info: PackageWorker.GetInfo(options.Info, output, error); break; case PackageTask.Prepare: PackageWorker.Prepare(options.PrepareDir, options.Exclusions, options.Version, options.Verbose, output, error); break; default: error.WriteLine($"Unexpected action '{action.ToString()}'"); return(1); } return(0); }