Skip to content

Instantly share code, notes, and snippets.

@isaacabraham
Created April 23, 2016 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacabraham/24a376d3fb6ca882528e42ccf4a8a9e0 to your computer and use it in GitHub Desktop.
Save isaacabraham/24a376d3fb6ca882528e42ccf4a8a9e0 to your computer and use it in GitHub Desktop.
open System
open System.IO
open System.Diagnostics
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
let timePrint s = printfn "%O: %s" (System.DateTime.UtcNow.TimeOfDay) s
timePrint "Downloading Paket..."
let psi = ProcessStartInfo(@"..\.paket\paket.bootstrapper.exe", UseShellExecute = false, CreateNoWindow = true, RedirectStandardOutput = true)
let x = Process.Start(psi)
x.WaitForExit()
timePrint (sprintf "%s" (x.StandardOutput.ReadToEnd()))
#r @"..\.paket\paket.exe"
open Paket
timePrint "Restoring dependencies..."
let dependencies = Dependencies.Locate "."
dependencies.Restore()
#I @"..\packages"
#r @"Newtonsoft.Json\lib\net45\Newtonsoft.Json.dll"
timePrint "Running application..."
open Newtonsoft.Json
type Customer = { Region : string; Name : string }
let customer = JsonConvert.DeserializeObject<Customer>(Environment.GetEnvironmentVariable("customer") |> File.ReadAllText)
timePrint (sprintf "%s: %A" customer.Region (DateTime.UtcNow.TimeOfDay.ToString()))
timePrint (sprintf "%A" customer)
timePrint (sprintf "%s: %A" customer.Region (DateTime.UtcNow.TimeOfDay.ToString()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment