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

This commit is contained in:
Albert S. 2022-06-02 09:05:49 +02:00
szülő db029dd915
commit 05606dd502

Fájl megtekintése

@ -53,17 +53,20 @@ int CommandUpdate::handle(QStringList arguments)
for(FileData &fileData : files)
{
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);
}
else
{
Logger::info() << "Would update" << fileData.absPath << Qt::endl;
if(!dryRun)
{
filePathsToUpdate.append(fileData.absPath);
}
else
{
Logger::info() << "Would update" << fileData.absPath << Qt::endl;
}
}
}
}