Skip to content

Commit

Permalink
fix issues cd'ing to a different drive
Browse files Browse the repository at this point in the history
  • Loading branch information
amitailanciano committed Nov 25, 2014
1 parent 7d627f3 commit 8394e58
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Lanayo.VagrantManager/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ private void ShowUpdateNotificationPreferenceChanged(Notification notification)

public void PerformVagrantAction(string action, VagrantInstance instance) {
if (action == "ssh") {
action = String.Format("cd {0} && vagrant ssh", Util.EscapeShellArg(instance.Path));
action = String.Format("cd /d {0} && vagrant ssh", Util.EscapeShellArg(instance.Path));
this.RunTerminalCommand(action);
} else {
this.RunVagrantAction(action, instance);
}
}
public void PerformVagrantAction(string action, VagrantMachine machine) {
if (action == "ssh") {
action = String.Format("cd {0} && vagrant ssh {1}", Util.EscapeShellArg(machine.Instance.Path), machine.Name);
action = String.Format("cd /d {0} && vagrant ssh {1}", Util.EscapeShellArg(machine.Instance.Path), machine.Name);
this.RunTerminalCommand(action);
} else {
this.RunVagrantAction(action, machine);
Expand All @@ -147,7 +147,7 @@ public void OpenInstanceInTerminal(VagrantInstance instance) {
if (Directory.Exists(instance.Path)) {
Process p = new Process();
p.StartInfo.FileName = "cmd";
p.StartInfo.Arguments = String.Format("/K cd {0}", instance.Path);
p.StartInfo.Arguments = String.Format("/K cd /d {0}", instance.Path);
p.Start();
} else {
MessageBox.Show("Path not found: " + instance.Path);
Expand Down Expand Up @@ -244,7 +244,7 @@ private void RunVagrantAction(string action, VagrantMachine machine) {
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.Arguments = String.Format("/C cd {0} && {1} {2}", Util.EscapeShellArg(machine.Instance.Path), command, Util.EscapeShellArg(machine.Name));
process.StartInfo.Arguments = String.Format("/C cd /d {0} && {1} {2}", Util.EscapeShellArg(machine.Instance.Path), command, Util.EscapeShellArg(machine.Name));

TaskOutputWindow outputWindow = new TaskOutputWindow();
outputWindow.Task = process;
Expand Down Expand Up @@ -282,7 +282,7 @@ private void RunVagrantAction(string action, VagrantInstance instance) {
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.Arguments = String.Format("/C cd {0} && {1}", Util.EscapeShellArg(instance.Path), command);
process.StartInfo.Arguments = String.Format("/C cd /d {0} && {1}", Util.EscapeShellArg(instance.Path), command);

TaskOutputWindow outputWindow = new TaskOutputWindow();
outputWindow.Task = process;
Expand Down
2 changes: 1 addition & 1 deletion Lanayo.VagrantManager/Core/Vagrant/VagrantInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void QueryMachines() {
FileName = "cmd",
WindowStyle = ProcessWindowStyle.Hidden,
CreateNoWindow = true,
Arguments = String.Format("/C cd {0} && vagrant status", Util.EscapeShellArg(_Path)),
Arguments = String.Format("/C cd /d {0} && vagrant status", Util.EscapeShellArg(_Path)),
UseShellExecute = false,
RedirectStandardOutput = true,
}
Expand Down

0 comments on commit 8394e58

Please sign in to comment.