Skip to content

Commit

Permalink
devops xamarin#11.
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbjarne committed Mar 26, 2019
1 parent f784ba7 commit 46054b3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions devops/build-samples.csx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ using System.IO;
using System.Net;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

using Newtonsoft.Json.Linq;

Expand Down Expand Up @@ -30,6 +31,16 @@ public static string DownloadWithGithubAuth (string uri)
if (!string.IsNullOrEmpty (authToken)) {
Console.WriteLine ("Has auth token!");
headers.Add (("Authorization", $"token {authToken}"));

Console.WriteLine ("Running curl");
var lines = new List<string> ();
var task = new Exec (
ProcessArguments.FromCommandAndArguments ("curl", new string [] { "-H", $"Authorization: token {authToken}", "-I", "-v", uri }),
ExecFlags.RedirectStdout | ExecFlags.RedirectStderr,
segment => Console.WriteLine (segment.Data.TrimEnd ('\r', '\n')))
.RunAsync ();
Task.WaitAny (task);
Console.WriteLine ("curled");
} else {
Console.WriteLine ("Does not have auth token!");
}
Expand Down

0 comments on commit 46054b3

Please sign in to comment.