Better Variable Names & Some Optimising
This commit is contained in:
parent
664c25b54d
commit
7b9b8e38dc
1 changed files with 9 additions and 18 deletions
|
@ -14,15 +14,13 @@ namespace Ryujinx
|
||||||
{
|
{
|
||||||
private static string _jobId;
|
private static string _jobId;
|
||||||
private static string _buildVer;
|
private static string _buildVer;
|
||||||
private static string _buildUrl = "https://ci.appveyor.com/api/projects/gdkchan/ryujinx/branch/master";
|
|
||||||
private static string _buildCommit;
|
|
||||||
private static string _branch;
|
|
||||||
private static string _platformExt;
|
private static string _platformExt;
|
||||||
|
|
||||||
public static string _buildArt;
|
private static string _masterUrl = "https://ci.appveyor.com/api/projects/gdkchan/ryujinx/branch/master";
|
||||||
|
private static string _buildUrl;
|
||||||
|
|
||||||
public static string RyuDir = Environment.CurrentDirectory;
|
public static string RyuDir = Environment.CurrentDirectory;
|
||||||
public static string localAppPath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Ryujinx");
|
public static string localAppPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Ryujinx");
|
||||||
public static WebClient Package = new WebClient();
|
public static WebClient Package = new WebClient();
|
||||||
public static int PackageProgress;
|
public static int PackageProgress;
|
||||||
public static double Percentage;
|
public static double Percentage;
|
||||||
|
@ -52,21 +50,14 @@ namespace Ryujinx
|
||||||
// Begin the Appveyor parsing
|
// Begin the Appveyor parsing
|
||||||
|
|
||||||
WebClient jsonClient = new WebClient();
|
WebClient jsonClient = new WebClient();
|
||||||
string fetchedJSON = jsonClient.DownloadString(_buildUrl);
|
string fetchedJSON = jsonClient.DownloadString(_masterUrl);
|
||||||
JObject jsonRoot = JObject.Parse(fetchedJSON);
|
JObject jsonRoot = JObject.Parse(fetchedJSON);
|
||||||
|
|
||||||
var __Build = jsonRoot["build"];
|
JToken _buildToken = jsonRoot["build"];
|
||||||
|
|
||||||
string __Version = (string)__Build["version"];
|
_jobId = (string)_buildToken["jobs"][0]["jobId"];
|
||||||
string __JobsId = (string)__Build["jobs"][0]["jobId"];
|
_buildVer = (string)_buildToken["version"];
|
||||||
string __branch = (string)__Build["branch"];
|
_buildUrl = "https://ci.appveyor.com/api/buildjobs/" + _jobId + "/artifacts/ryujinx-" + _buildVer + "-" + _platformExt;
|
||||||
string __buildCommit = (string)__Build["commitId"];
|
|
||||||
|
|
||||||
_jobId = __JobsId;
|
|
||||||
_buildVer = __Version;
|
|
||||||
_buildArt = "https://ci.appveyor.com/api/buildjobs/" + _jobId + "/artifacts/ryujinx-" + _buildVer + "-" + _platformExt;
|
|
||||||
_buildCommit = __buildCommit.Substring(0, 7);
|
|
||||||
_branch = __branch;
|
|
||||||
|
|
||||||
if (!Directory.Exists(localAppPath))
|
if (!Directory.Exists(localAppPath))
|
||||||
{
|
{
|
||||||
|
@ -110,7 +101,7 @@ namespace Ryujinx
|
||||||
string updaterPath = Path.Combine(RyuDir, "Updater.exe");
|
string updaterPath = Path.Combine(RyuDir, "Updater.exe");
|
||||||
|
|
||||||
ProcessStartInfo startInfo = new ProcessStartInfo(updaterPath);
|
ProcessStartInfo startInfo = new ProcessStartInfo(updaterPath);
|
||||||
startInfo.Arguments = _buildArt + " " + _buildVer;
|
startInfo.Arguments = _buildUrl + " " + _buildVer;
|
||||||
startInfo.UseShellExecute = true;
|
startInfo.UseShellExecute = true;
|
||||||
Process.Start(startInfo);
|
Process.Start(startInfo);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue