Skip to content

Commit

Permalink
Resolve Error: Could not find part of path (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
nvisionative authored Apr 24, 2019
1 parent be4abf8 commit 1a97780
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions nvQuickSite/Controllers/PackageController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.IO;
using System.Reflection;

namespace nvQuickSite.Controllers
Expand Down Expand Up @@ -30,6 +31,12 @@ public static IEnumerable<Package> GetPackageList()
}
private static void SaveLocalPackagesFile(IEnumerable<Package> packages)
{
var downloadDirectory = GetDownloadDirectory();
if (!Directory.Exists(downloadDirectory))
{
Directory.CreateDirectory(downloadDirectory);
}

var pfile = System.IO.Directory.GetCurrentDirectory() + @"\Downloads\packages.json";
using (var sw = new System.IO.StreamWriter(pfile))
{
Expand Down Expand Up @@ -66,5 +73,10 @@ private static IEnumerable<Package> GetRemotePackages()
return new List<Package>();
}

private static string GetDownloadDirectory()
{
return Directory.GetCurrentDirectory() + @"\Downloads\";
}

}
}

0 comments on commit 1a97780

Please sign in to comment.