mirror of https://gitlab.com/basile.b/dexed.git
fix #448 - conversion to json fails depending on dub cwd
This commit is contained in:
parent
9950ad41d9
commit
7151d1ab93
|
@ -1746,15 +1746,25 @@ var
|
||||||
jsn: TJSONData = nil;
|
jsn: TJSONData = nil;
|
||||||
prs: TJSONParser;
|
prs: TJSONParser;
|
||||||
t: string;
|
t: string;
|
||||||
|
d: string;
|
||||||
begin
|
begin
|
||||||
result := nil;
|
result := nil;
|
||||||
dub := TProcess.Create(nil);
|
dub := TProcess.Create(nil);
|
||||||
str := TStringList.Create;
|
str := TStringList.Create;
|
||||||
|
|
||||||
|
// see note about chdir
|
||||||
|
d := GetCurrentDir;
|
||||||
|
|
||||||
try
|
try
|
||||||
dub.Executable := 'dub' + exeExt;
|
dub.Executable := 'dub' + exeExt;
|
||||||
dub.Options := [poUsePipes{$IFDEF WINDOWS}, poNewConsole{$ENDIF}];
|
dub.Options := [poUsePipes{$IFDEF WINDOWS}, poNewConsole{$ENDIF}];
|
||||||
dub.ShowWindow := swoHIDE;
|
dub.ShowWindow := swoHIDE;
|
||||||
dub.CurrentDirectory:= filename.extractFilePath;
|
dub.CurrentDirectory:= filename.extractFilePath;
|
||||||
|
|
||||||
|
// need to move because it looks like DUB doesn't use
|
||||||
|
// the cd specified for the process we launch here.
|
||||||
|
chdir(dub.CurrentDirectory);
|
||||||
|
|
||||||
dub.Parameters.Add('convert');
|
dub.Parameters.Add('convert');
|
||||||
dub.Parameters.Add('-s');
|
dub.Parameters.Add('-s');
|
||||||
dub.Parameters.Add('-f');
|
dub.Parameters.Add('-f');
|
||||||
|
@ -1786,6 +1796,10 @@ begin
|
||||||
result := nil;
|
result := nil;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
|
|
||||||
|
// see note about chdir
|
||||||
|
chdir(d);
|
||||||
|
|
||||||
dub.free;
|
dub.free;
|
||||||
str.Free;
|
str.Free;
|
||||||
end;
|
end;
|
||||||
|
|
Loading…
Reference in New Issue