| 1234567891011121314151617181920212223242526272829303132333435363738 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace SharpGLTF
- {
- /// <summary>
- /// Utility class to download the gltf2 schema from github
- /// </summary>
- static class SchemaDownload
- {
- public static void Syncronize(string remoteUrl, string localDirectory)
- {
- if (LibGit2Sharp.Repository.Discover(localDirectory) == null)
- {
- Console.WriteLine($"Cloning {remoteUrl} can take several minutes; Please wait...");
- LibGit2Sharp.Repository.Clone(remoteUrl, localDirectory);
- Console.WriteLine($"... Clone Completed");
- return;
- }
- using (var repo = new LibGit2Sharp.Repository(localDirectory))
- {
- var options = new LibGit2Sharp.PullOptions
- {
- FetchOptions = new LibGit2Sharp.FetchOptions()
- };
- var r = LibGit2Sharp.Commands.Pull(repo, new LibGit2Sharp.Signature("Anonymous", "[email protected]", new DateTimeOffset(DateTime.Now)), options);
- Console.WriteLine($"{remoteUrl} is {r.Status}");
- }
- }
- }
- }
|