fix runnable currdir not set properly when executing or when running

This commit is contained in:
Basile Burg 2019-02-04 00:26:11 +01:00
parent e7708131db
commit 6db535128c
1 changed files with 2 additions and 1 deletions

View File

@ -3085,6 +3085,7 @@ begin
dmdproc.OnReadData := @asyncprocOutput;
dmdproc.OnTerminate:= @asyncprocTerminate;
dmdproc.Options := [poUsePipes, poStderrToOutPut];
dmdproc.CurrentDirectory:=fDoc.fileName.extractFileDir;
case fRunnablesOptions.compiler of
dmd: dmdProc.Executable := fCompilerSelector.getCompilerPath(dmd);
gdc, gdmd: dmdProc.Executable := fCompilerSelector.getCompilerPath(gdmd);
@ -3228,13 +3229,13 @@ begin
end;
lst := TStringList.Create;
try
fRunProc.CurrentDirectory := fRunProc.Executable.extractFileDir;
if runArgs.isNotEmpty then
begin
CommandToList(fSymStringExpander.expand(runArgs), lst);
fRunProc.Parameters.AddStrings(lst);
end;
fRunProc.Executable := fname;
fRunProc.CurrentDirectory := fRunProc.Executable.extractFileDir;
if unittest and fCovModUt then
fRunProc.OnTerminate:=@unittestDone;
if redirect then