func downloadPackage(name,version,path) { var uri = $"https://cpkg.tesseslanguage.com/api/v1/download?name={Net.Http.UrlEncode(name)}&version={Net.Http.UrlEncode(version)}"; var req = Net.Http.MakeRequest(uri); if(req.StatusCode == 200) { var strm = FS.MemoryStream(true); req.CopyToStream(strm); var f = FS.Local.OpenFile(path,"wb"); strm.Seek(0,0); strm.CopyTo(f); f.Close(); strm.Close(); req.Close(); } else { throw $"Error when downloading package {name} with version {version}"; } } var shellDir = Path.FromString(Env.Config) / "Tesses" / "CrossLang" / "Shell"; FS.Local.CreateDirectory(shellDir); downloadPackage("Tesses.CrossLang.Shell", "1.0.0.0-prod", shellDir / "Shell.crvm"); downloadPackage("Tesses.CrossLang.Args", "1.0.0.0-prod", shellDir / "Tesses.CrossLang.Args-1.0.0.0-prod.crvm"); downloadPackage("Tesses.CrossLang.Args", "1.0.0.0-prod", shellDir / "Tesses.CrossLang.BuildEssentials-1.0.0.0-prod.crvm");