Skip to content

Commit 07c27b2

Browse files
committed
Extending the path settings to support the DEPLOY_PATH variable
Former-commit-id: 8c35bdf2803b38972b3b588a7c066d2bbc807986 [formerly 92f6e03a482509036ef9de10c6285542f0744608] [formerly 45fac1f2b5689b54f324f9d2e90552e4bb95fb72 [formerly 8e6208cc5207e94a319f7b560ee1034bcd143999]] Former-commit-id: e1b6587fd9c812a7548ba28420430e2c056a6ab6 [formerly 9faa619a7ed7227ad87432f6267bd2bc6e99c10c] Former-commit-id: e77110360cc371af640525ee4a0fcc50100a6054
1 parent c0c5429 commit 07c27b2

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/PyEnvironment.Path.pas

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ interface
3434

3535
type
3636
TPyEnvironmentPath = class
37+
public const
38+
DEPLOY_PATH = '$(DEPLOY_PATH)';
39+
public
3740
/// <summary>
3841
/// This function might resolve path variables, relative paths and whatever regarding paths
3942
/// </summary>
@@ -48,16 +51,16 @@ implementation
4851
{ TPyEnvironmentPath }
4952

5053
class function TPyEnvironmentPath.ResolvePath(const APath: string): string;
51-
var
52-
LFilePath: string;
5354
begin
54-
if (APath <> ExpandFileName(APath)) then begin
55+
if (APath <> ExpandFileName(APath)) or (APath = DEPLOY_PATH) then begin
5556
{$IFDEF ANDROID}
56-
LFilePath := TPath.GetDocumentsPath();
57+
Result := TPath.GetDocumentsPath();
5758
{$ELSE}
58-
LFilePath := TPath.GetDirectoryName(GetModuleName(HInstance));
59+
Result := TPath.GetDirectoryName(GetModuleName(HInstance));
5960
{$ENDIF}
60-
Result := TPath.Combine(LFilePath, APath);
61+
62+
if (APath <> DEPLOY_PATH) then
63+
Result := TPath.Combine(Result, APath);
6164
end else
6265
Result := APath;
6366
end;

0 commit comments

Comments
 (0)