bau
bau copied to clipboard
BauExec: How to run programs from the path?
The Exec task has ShellExecute = false
for reasons which are understood but because of this I am unable to execute programs that are located on the system path. Is there or should there be a way to specify that the command should be located on the system/user PATH? Currently if I need to run a program located on the PATH I am doing this:
.Task("npm")
.Do(() => {
new System.Diagnostics.ProcessStartInfo("npm"){
Arguments = "install",
WorkingDirectory = repositoryDir.FullName
}.Run();
})
Major edit: I meant false
, not true
!
May need to create something to parse Environment.GetEnvironmentVariable ("PATH")
for multiple platforms.
xbuild looks like it creates a temporary script file containing for example "bower install" and then it calls that script using an absolute path.
I would propose the addition of a boolean property, like public bool SearchPath { get; set; }
that will trigger logic that will search the PATH environment variable for the full location of the desired executable.