cli: CommandUpdate: When path is a dir, don't do anything (no deletion or updates)

Tento commit je obsažen v:
Albert S. 2022-06-02 09:05:49 +02:00
rodič db029dd915
revize 05606dd502

Zobrazit soubor

@ -53,17 +53,20 @@ int CommandUpdate::handle(QStringList arguments)
for(FileData &fileData : files) for(FileData &fileData : files)
{ {
QFileInfo fileInfo(fileData.absPath); QFileInfo fileInfo(fileData.absPath);
if(fileInfo.exists() && fileInfo.isFile()) if(fileInfo.exists())
{ {
if(fileInfo.lastModified().toSecsSinceEpoch() != fileData.mtime) if(fileInfo.isFile())
{ {
if(!dryRun) if(fileInfo.lastModified().toSecsSinceEpoch() != fileData.mtime)
{ {
filePathsToUpdate.append(fileData.absPath); if(!dryRun)
} {
else filePathsToUpdate.append(fileData.absPath);
{ }
Logger::info() << "Would update" << fileData.absPath << Qt::endl; else
{
Logger::info() << "Would update" << fileData.absPath << Qt::endl;
}
} }
} }
} }