-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
feat(utils): Support non-exe commands on Windows #2019
Conversation
Have added support to the `utils::exec_cmd` to allow it to execute commands that are not `.exe` on Windows. Have also added a timer to measure how long a command took to execute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Elixir version shows up with this on windows (It takes 250ms, but it's also this slow when not run with starship).
@@ -243,14 +244,31 @@ pub fn wrap_seq_for_shell( | |||
|
|||
fn internal_exec_cmd(cmd: &str, args: &[&str]) -> Option<CommandOutput> { | |||
log::trace!("Executing command {:?} with args {:?}", cmd, args); | |||
match Command::new(cmd).args(args).output() { | |||
|
|||
let full_path = match which::which(cmd) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth it to build a map of all the exetuables in the PATH
in the future, to avoid having to walk the whole PATH
on each invocation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that might be something to look at in the future or maybe something we can get added to the upstream library.
Thanks for the review @davidkna |
Have added support to the `utils::exec_cmd` to allow it to execute commands that are not `.exe` on Windows. Have also added a timer to measure how long a command took to execute.
Have added support to the `utils::exec_cmd` to allow it to execute commands that are not `.exe` on Windows. Have also added a timer to measure how long a command took to execute.
Description
Have added support to the
utils::exec_cmd
to allow it to executecommands that are not
.exe
on Windows. Have also added a timer tomeasure how long a command took to execute.
Motivation and Context
Closes #983
Closes #2018
Screenshots (if appropriate):
How Has This Been Tested?
Checklist: