public static void SaveRepositoriesList(string toPath) { var repo = new Repository { PackageName = "SSE", PackageURL = @"https://github.com/Aeal/SSE.git", PackageMaintainer = @"Aeal", PackageVersion = 1, InfoUrl = @"https://raw.github.com/Aeal/SSE/info.ups" }; var source = new UPMSource(); source.AddRepo(repo); var collections = new GitHubRepositoryCollection(); collections.GET_URL = "https://api.github.com/orgs/UPMCollection/repos"; source.AddCollection(collections); source.UpdateSources(); var builder = new StringBuilder(); var jsonSettings = new JsonWriter(builder); jsonSettings.PrettyPrint = true; JsonMapper.ToJson(source, jsonSettings); using (TextWriter writer = new StreamWriter(toPath)) { writer.Write(builder); } var rbuilder = new StringBuilder(); var settings = new JsonWriter(rbuilder); settings.PrettyPrint = true; JsonMapper.ToJson(repo, settings); using (TextWriter twriter = new StreamWriter(toPath + ".r")) { twriter.Write(rbuilder); } }
public static void LoadRemoteRepos() { remoteSources = LoadSources(UPM_MASTER_REPOS_LOCAL); Debug.Log("Loaded sources: " + remoteSources.Repositories[0].PackageName); }