コード例 #1
0
 public UploadToBloomLibrary(UploadOptions opts)
 {
     _options = opts;
     if (_options.VeryVerbose)
     {
         _options.Verbose = true;
     }
 }
コード例 #2
0
        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.");
            }
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: BloomBooks/RoseGarden
 private static int UploadAndReturnExitCode(UploadOptions opts)
 {
     return(new UploadToBloomLibrary(opts).RunUpload());
 }