Ejemplo n.º 1
0
        /// <summary>
        /// Executes the task.
        /// </summary>
        protected override void ExecuteTask()
        {
            var filename = Project.GetFullPath(Filename);

            if (!File.Exists(filename))
            {
                Project.Log(this, Level.Error, string.Format("File {0} not found.", filename));
            }
            var downloads = new Downloads(Repository, UserName, UserToken);

            Project.Log(this, Level.Info, string.Format("Uploading {0} to {1}.", filename, Repository));
            downloads.AddFile(filename, Description);
        }
Ejemplo n.º 2
0
        private static void Upload(string[] args)
        {
            if (args.Length < 2)
            {
                Usage();
                return;
            }

            var myArgs = new string[4];
            Array.Copy(args.ToArray(), myArgs, Math.Min(args.Length, myArgs.Length));

            var config = new GitConfiguration();
            var upload = new Downloads(myArgs[1], myArgs[2] ?? config.GetValue("github.user"), myArgs[3] ?? config.GetValue("github.token"));
            Console.WriteLine(upload.AddFile(myArgs[0]));
        }
Ejemplo n.º 3
0
        private static void Upload(string[] args)
        {
            if (args.Length < 2)
            {
                Usage();
                return;
            }

            var myArgs = new string[4];

            Array.Copy(args.ToArray(), myArgs, Math.Min(args.Length, myArgs.Length));

            var config = new GitConfiguration();
            var upload = new Downloads(myArgs[1], myArgs[2] ?? config.GetValue("github.user"), myArgs[3] ?? config.GetValue("github.token"));

            Console.WriteLine(upload.AddFile(myArgs[0]));
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Executes the task.
 /// </summary>
 protected override void ExecuteTask()
 {
     var filename = Project.GetFullPath(Filename);
     if (!File.Exists(filename))
     {
         Project.Log(this, Level.Error, string.Format("File {0} not found.", filename));
     }
     var downloads = new Downloads(Repository, UserName, UserToken);
     Project.Log(this, Level.Info, string.Format("Uploading {0} to {1}.", filename, Repository));
     downloads.AddFile(filename, Description);
 }