public UploadToBloomLibrary(UploadOptions opts) { _options = opts; if (_options.VeryVerbose) { _options.Verbose = true; } }
private void UploadBooks() { var uploadOptions = new UploadOptions { Verbose = _options.Verbose, VeryVerbose = _options.VeryVerbose, SingleBookshelfLevel = true, BloomExe = _options.BloomExe, BookShelfContainer = TrimBookShelfContainerToBaseFolder(), UploadUser = _options.UploadUser, UploadPassword = _options.UploadPassword }; if (_options.DryRun || _options.DoNotUpload) { var command = new StringBuilder(); command.Append("RoseGarden upload -s"); if (uploadOptions.VeryVerbose) { command.Append(" -V"); } else if (uploadOptions.Verbose) { command.Append(" -v"); } command.AppendFormat(" -b \"{0}\"", uploadOptions.BloomExe); command.AppendFormat(" \"{0}\"", uploadOptions.BookShelfContainer); Console.WriteLine(command); return; } Console.WriteLine("INFO: trying to upload the books."); var upload = new UploadToBloomLibrary(uploadOptions); if (upload.RunUpload() == 0) { Console.WriteLine("INFO: uploading the books appears to have succeeded."); } else { Console.WriteLine("WARNING: uploading the books appears to have failed."); } }
private static int UploadAndReturnExitCode(UploadOptions opts) { return(new UploadToBloomLibrary(opts).RunUpload()); }