Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempted fix of #152 #156

Merged
merged 1 commit into from
Oct 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
{
}
}
}
}