How to download the latest version of the project from Github to a local disk?

116 Views Asked by At

I usually download a project by reference see Screenshot
But i want to know how to program and save to local disk using octokit.net:
- save in “zip” format?
- or in unpacked format?

I try to use the code, but creates an empty archive "* .zip"

var latestAsset = await client.Repository.Get("Ryozuki", "HelperBot");

//Download Release.zip here
var response = await client.Connection.Get<object>(new Uri(latestAsset.Url),
    new Dictionary<string, string>(), null);

byte[] bytes = Encoding.ASCII.GetBytes(response.HttpResponse.Body.ToString()); ;
File.WriteAllBytes("RyozukiHelperBot.zip", bytes);

Link repo - https://github.com/Ryozuki/HelperBot

0

There are 0 best solutions below