Skip to content

Commit

Permalink
Attempted fix of #152
Browse files Browse the repository at this point in the history
  • Loading branch information
BlythMeister committed Oct 20, 2017
1 parent a4549de commit 7aa181c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/Paket.VisualStudio/Commands/AddPackageProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ public static void ShowAddPackageDialog(string selectedFileName, string projectG
}
catch (Exception)
{
var dir = new System.IO.FileInfo(SolutionExplorerExtensions.GetSolutionFileName()).Directory.FullName;
PaketLauncher.LaunchPaket(dir, "init",
PaketLauncher.LaunchPaket(SolutionExplorerExtensions.GetPaketDirectory(), "init",
(send, args) => PaketOutputPane.OutputPane.OutputStringThreadSafe(args.Data + "\n"));
dependenciesFile = Dependencies.Locate(selectedFileName);
}
Expand Down
9 changes: 6 additions & 3 deletions src/Paket.VisualStudio/Utils/PaketLauncher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ private static int LaunchProcess(string SolutionDirectory, string FileName, stri

public static void LaunchPaket(string SolutionDirectory, string PaketSubCommand, DataReceivedEventHandler PaketDataReceivedHandler)
{
if (!File.Exists(SolutionDirectory + PAKET_EXE))
var paketLocation = Path.Combine(SolutionDirectory, PAKET_EXE);
var paketBootstrapLocation = Path.Combine(SolutionDirectory, PAKET_BOOTSTRAPPER_EXE);

if (!File.Exists(paketLocation))
{
//If .paket\paket.exe is not found under the solution dir, try launching paket.bootstrapper.exe
if (File.Exists(SolutionDirectory + PAKET_BOOTSTRAPPER_EXE))
if (File.Exists(paketBootstrapLocation))
{
int ExitCode = LaunchProcess(SolutionDirectory, PAKET_BOOTSTRAPPER_EXE, "", PaketDataReceivedHandler);
if (ExitCode != 0)
Expand Down Expand Up @@ -77,4 +80,4 @@ public PaketRuntimeException(string message, Exception inner)
{
}
}
}
}

0 comments on commit 7aa181c

Please sign in to comment.