-
-
Save realvictorprm/d95bf2c45b5cb6cc3afa04465055cb94 to your computer and use it in GitHub Desktop.
open System | |
open System.IO | |
open System.Diagnostics | |
let downloadDependencies deps = | |
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__ | |
if not (File.Exists "paket.exe") then | |
async { | |
let url = "http://fsprojects.github.io/Paket/stable" | |
use wc = new Net.WebClient() | |
wc.DownloadProgressChanged.Add(fun a -> printfn "Progress downloading paket.exe: %d" a.ProgressPercentage) | |
let tmp = Path.GetTempFileName() | |
let stable = wc.DownloadString(url) | |
do! wc.AsyncDownloadFile(stable |> Uri, tmp) | |
File.Move(tmp,Path.GetFileName stable) | |
} |> Async.RunSynchronously | |
printfn "Finished downloading paket.exe!" | |
let invokePaket args = | |
use process = | |
new Process( | |
StartInfo = | |
new ProcessStartInfo( | |
FileName = "./paket.exe", | |
Arguments = args, | |
UseShellExecute = false)) | |
process.Start() |> ignore | |
process.WaitForExit() | |
if not (File.Exists "paket.dependencies") && not (File.Exists "paket.lock") then | |
invokePaket "init" | |
for dep in deps do | |
sprintf "add %s" dep | |
|> invokePaket | |
downloadDependencies [ "MathNet.Numerics"; "MathNet.Numerics.FSharp"] // Append the package names to this list! |
@amieres What version of Paket are you using? I think I got that once because of some change that Github made, and it required updating my Paket version.
I think I've also "resolved" that error by simply trying it again (was a transient network issue).
@amieres @NatElkins @realvictorprm
Might want to add:
System.Net.ServicePointManager.SecurityProtocol <- System.Net.SecurityProtocolType.Tls12 // Github uses TLS 1.2
to the top of the file after open statements.
I get this when pasting downloadDependencies into fsi:
warning FS0046: The identifier 'process' is reserved for future use by F#
@amieres that's not about paket. GitHub has disabled TLS <= 1.2 How to enable TLS 1.2.
Might want to add:
System.Net.ServicePointManager.SecurityProtocol <- System.Net.SecurityProtocolType.Tls12 // Github uses TLS 1.2
to the top of the file after open statements.
You are right! That did the trick.
Thank you!
Good idea. Although I'm getting this message: