kopia lustrzana https://github.com/espressif/esp-idf
tools: installer: fix copying IDF to a destination on another drive
Closes https://github.com/espressif/esp-idf/issues/4128 Closes https://github.com/espressif/esp-idf/issues/4744pull/4752/head
rodzic
7a18f02acd
commit
b67a7f48a9
|
@ -87,7 +87,7 @@ begin
|
|||
CmdLine := GitExecutablePath + ' -C ' + Path + ' submodule foreach git repack -d -a'
|
||||
DoCmdlineInstall('Finishing ESP-IDF installation', 'Re-packing the submodules', CmdLine);
|
||||
|
||||
FindFileRecusive(Path + '\.git', 'alternates', @RemoveAlternatesFile);
|
||||
FindFileRecursive(Path + '\.git', 'alternates', @RemoveAlternatesFile);
|
||||
end;
|
||||
|
||||
{ Run git reset --hard in the repo and in the submodules, to fix the newlines. }
|
||||
|
@ -122,7 +122,6 @@ var
|
|||
IDFTempPath: String;
|
||||
IDFPath: String;
|
||||
NeedToClone: Boolean;
|
||||
Res: Boolean;
|
||||
|
||||
begin
|
||||
IDFPath := IDFDownloadPath;
|
||||
|
@ -168,7 +167,7 @@ begin
|
|||
GitRepoDissociate(IDFPath);
|
||||
|
||||
end else begin
|
||||
Log('Moving ' + IDFTempPath + ' to ' + IDFPath);
|
||||
Log('Copying ' + IDFTempPath + ' to ' + IDFPath);
|
||||
if DirExists(IDFPath) then
|
||||
begin
|
||||
if not DirIsEmpty(IDFPath) then
|
||||
|
@ -176,21 +175,16 @@ begin
|
|||
MsgBox('Destination directory exists and is not empty: ' + IDFPath, mbError, MB_OK);
|
||||
RaiseException('Failed to copy ESP-IDF')
|
||||
end;
|
||||
|
||||
Res := RemoveDir(IDFPath);
|
||||
if not Res then
|
||||
begin
|
||||
MsgBox('Failed to remove destination directory: ' + IDFPath, mbError, MB_OK);
|
||||
RaiseException('Failed to copy ESP-IDF')
|
||||
end;
|
||||
end;
|
||||
Res := RenameFile(IDFTempPath, IDFPath);
|
||||
if not Res then
|
||||
begin
|
||||
MsgBox('Failed to copy ESP-IDF to the destination directory: ' + IDFPath, mbError, MB_OK);
|
||||
RaiseException('Failed to copy ESP-IDF');
|
||||
end;
|
||||
{ If cmd.exe command argument starts with a quote, the first and last quote chars in the command
|
||||
will be removed by cmd.exe.
|
||||
Keys explanation: /s+/e includes all subdirectories, /i assumes that destination is a directory,
|
||||
/h copies hidden files, /q disables file name logging (making copying faster!)
|
||||
}
|
||||
CmdLine := ExpandConstant('cmd.exe /c ""xcopy" /s /e /i /h /q "' + IDFTempPath + '" "' + IDFPath + '""');
|
||||
DoCmdlineInstall('Extracting ESP-IDF', 'Copying ESP-IDF into the destination directory', CmdLine);
|
||||
GitRepoFixNewlines(IDFPath);
|
||||
DelTree(IDFTempPath, True, True, True);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ end;
|
|||
type
|
||||
TFindFileCallback = procedure(Filename: String);
|
||||
|
||||
procedure FindFileRecusive(Directory: string; FileName: string; Callback: TFindFileCallback);
|
||||
procedure FindFileRecursive(Directory: string; FileName: string; Callback: TFindFileCallback);
|
||||
var
|
||||
FindRec: TFindRec;
|
||||
FilePath: string;
|
||||
|
@ -107,7 +107,7 @@ begin
|
|||
FilePath := Directory + '\' + FindRec.Name;
|
||||
if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY <> 0 then
|
||||
begin
|
||||
FindFileRecusive(FilePath, FileName, Callback);
|
||||
FindFileRecursive(FilePath, FileName, Callback);
|
||||
end else if CompareText(FindRec.Name, FileName) = 0 then
|
||||
begin
|
||||
Callback(FilePath);
|
||||
|
|
Ładowanie…
Reference in New Issue