Beispiel #1
0
        static void Main(string[] args)
        {
            // See README.md for setting up GHPL_TOKEN envirnoment variable before running...

            var token = Environment.GetEnvironmentVariable(
                    TOKEN_KEY,
                    EnvironmentVariableTarget.User
                );

            var owner = ConfigurationManager.AppSettings[OWNER_KEY];
            var repo = ConfigurationManager.AppSettings[REPO_KEY];

            PrintHeader(token, owner, repo);

            Console.WriteLine();
            Console.WriteLine("Ensuring current version of file is in the repo...");

            var service = new ContentService(token);

            var file = new DiskFile("Files/content_file.gif");
            var target = new FileTarget(owner, repo, file.Name);

            service.PushFile(file, target, "pushing file via GitHubPushLib");

            Console.WriteLine("Finished!");
            Console.Read();
        }
Beispiel #2
0
        public static void uploadFileToGit(string fileName)
        {
            Console.Write("Github Username:"******"pushing file via GitHubPushLib");
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }