Browse Source
Don't assume executables are relative to the context directory. (#161)
- This allows running executables that are on the path.
davidfowl/dependencies
David Fowler
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
1 deletions
-
src/Microsoft.Tye.Hosting/ProcessRunner.cs
|
|
|
@ -75,7 +75,9 @@ namespace Microsoft.Tye.Hosting |
|
|
|
else if (serviceDescription.RunInfo is ExecutableRunInfo executable) |
|
|
|
{ |
|
|
|
var expandedExecutable = Environment.ExpandEnvironmentVariables(executable.Executable); |
|
|
|
path = Path.GetFullPath(Path.Combine(application.ContextDirectory, expandedExecutable)); |
|
|
|
path = Path.GetExtension(expandedExecutable) == ".dll" ? |
|
|
|
Path.GetFullPath(Path.Combine(application.ContextDirectory, expandedExecutable)) : |
|
|
|
expandedExecutable; |
|
|
|
workingDirectory = executable.WorkingDirectory != null ? |
|
|
|
Path.GetFullPath(Path.Combine(application.ContextDirectory, Environment.ExpandEnvironmentVariables(executable.WorkingDirectory))) : |
|
|
|
Path.GetDirectoryName(path)!; |
|
|
|
|