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

Draft: execute using configured console #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
15 changes: 14 additions & 1 deletion src/OpenCommandLine/OpenCommandLinePackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,18 @@ private void ExecuteFile(object sender, EventArgs e)
}
else
{
StartProcess(folder, "cmd.exe", "/k \"" + Path.GetFileName(path) + "\"");
var options = GetDialogPage(typeof(Options)) as Options;
string arguments = (options.Arguments ?? string.Empty).Replace("%folder%", folder);

string confName = VsHelpers.GetSolutionConfigurationName(_dte);
arguments = arguments.Replace("%configuration%", confName);

string confPlatform = VsHelpers.GetSolutionConfigurationPlatformName(_dte);
arguments = arguments.Replace("%platform%", confPlatform);

arguments = arguments.Replace("%file%", Path.GetFileName(path));
Comment on lines -79 to +88
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be refactored to be more reusable


StartProcess(folder, options.Command, arguments);
}
}

Expand All @@ -102,6 +113,8 @@ private void OpenCustom(object sender, EventArgs e)
string confPlatform = VsHelpers.GetSolutionConfigurationPlatformName(_dte);
arguments = arguments.Replace("%platform%", confPlatform);

arguments = arguments.Replace("%file%", string.Empty);
Copy link
Author

@Atrejoe Atrejoe Oct 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any configure %file% parameter need to be remove when just opening the console


StartProcess(folder, options.Command, arguments);
}

Expand Down