src/Microsoft.Crank.Agent/Startup.cs
/// <summary>
/// Parses files that contain two lines: a sha and a version
/// </summary>
Parses files that contain two lines: a sha and a version
Parses files that contain two lines : a sha and a version
private static async Task<(string version, string hash)> ParseLatestVersionFile(string urlOrFilename)
        {
            var content = urlOrFilename.StartsWith("http", StringComparison.OrdinalIgnoreCase)
                ? await DownloadContentAsync(urlOrFilename)
                : await File.ReadAllTextAsync(urlOrFilename)
                ;
            using (var sr = new StringReader(content))
            {
                var hash = sr.ReadLine();
                var version = sr.ReadLine();
                return (version, hash);
            }
        }
private static async Task < ( string version , string hash ) > ParseLatestVersionFile ( string urlOrFilename ) { var content = urlOrFilename . StartsWith ( " " , StringComparison . OrdinalIgnoreCase ) ? await DownloadContentAsync ( urlOrFilename ) : await File . ReadAllTextAsync ( urlOrFilename ) ; using ( var sr = new StringReader ( content ) ) { var hash = sr . ReadLine ( ) ; var version = sr . ReadLine ( ) ; return ( version , hash ) ; } }
Parses files that contain two lines: a sha and a version
Parses files that contain two lines : a sha and a version
urlOrFilename
string