mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 23:25:56 +02:00
IDE: Publish feature: prevent failure when the publish directory is a subfolder of the source directory.
git-svn-id: trunk@58876 -
This commit is contained in:
parent
d049fe0df4
commit
ee22bab977
@ -3877,6 +3877,10 @@ resourcestring
|
||||
+'comma and semicolon separates alternatives. For example: Simple '
|
||||
+'syntax *.pas;*.pp corresponds to ^(.*\.pas|.*\.pp)$';
|
||||
lisUseFilterForExtraFiles = 'Use filter to include extra files';
|
||||
lisCopyFilesFailed = 'Copying files failed';
|
||||
lisCopyPackagesFailed = 'Copying packages failed';
|
||||
lisWriteProjectInfoFailed = 'Writing the project info file failed';
|
||||
lisWritePackageInfoFailed = 'Writing the package info file failed';
|
||||
lisIncludeFilter = 'Include filter';
|
||||
lisInvalidPublishingDirectory = 'Invalid publishing Directory';
|
||||
lisEmptyDestinationForPublishing = 'Destination directory for publishing'
|
||||
|
@ -31,7 +31,7 @@ unit PublishModuleDlg;
|
||||
|
||||
// Define this to test publishing to a subdirectory of the project/package dir.
|
||||
// Now it creates a recursive loop.
|
||||
{.$define AllowProjectSubDirectory}
|
||||
{$define AllowProjectSubDirectory}
|
||||
|
||||
interface
|
||||
|
||||
@ -196,6 +196,11 @@ begin
|
||||
DebugLn(['DoFileFound: In Backup or Output dir, not copied: ', FileName]);
|
||||
Exit;
|
||||
end;
|
||||
if (CurDir = FDestDir) then
|
||||
begin
|
||||
DebugLn(['DoFileFound: The destination directory is in the same folder as the source files, not copied: ', FileName]);
|
||||
Exit;
|
||||
end;
|
||||
if FOptions.FileCanBePublished(FileName) then
|
||||
begin
|
||||
if CopyAFile(FileName) <> mrOK then
|
||||
@ -480,13 +485,32 @@ begin
|
||||
if FOptions is TPublishProjectOptions then
|
||||
begin
|
||||
Result := CopyProjectFiles;
|
||||
if Result<>mrOk then exit;
|
||||
if Result <> mrOk then
|
||||
begin
|
||||
IDEMessageDialog(lisError, lisCopyFilesFailed, mtInformation,[mbOk]);
|
||||
exit;
|
||||
end;
|
||||
Result := WriteProjectInfo;
|
||||
if Result <> mrOk then
|
||||
begin
|
||||
IDEMessageDialog(lisError, lisWriteProjectInfoFailed, mtInformation,[mbOk]);
|
||||
exit;
|
||||
end;
|
||||
end
|
||||
else begin
|
||||
Result := CopyPackageFiles;
|
||||
if Result<>mrOk then exit;
|
||||
if Result <> mrOk then
|
||||
begin
|
||||
IDEMessageDialog(lisError, lisCopyPackagesFailed, mtInformation,[mbOk]);
|
||||
exit;
|
||||
end;
|
||||
Result := WritePackageInfo;
|
||||
if Result <> mrOk then
|
||||
begin
|
||||
IDEMessageDialog(lisError, lisWritePackageInfoFailed, mtInformation,[mbOk]);
|
||||
exit;
|
||||
end;
|
||||
|
||||
end;
|
||||
if Result<>mrOk then exit;
|
||||
|
||||
@ -504,6 +528,7 @@ begin
|
||||
end;
|
||||
if FCopyFailedCount <> 0 then
|
||||
begin
|
||||
IDEMessageDialog(lisError, lisCopyFilesFailed, mtInformation,[mbOk]);
|
||||
DebugLn('Hint: [TPublisher] Copying files failed');
|
||||
exit(mrCancel);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user