Skip to content

Commit

Permalink
Fix tgz name and subfolder name mismatch (#169)
Browse files Browse the repository at this point in the history
After extracting, checking the subdir for the tgz name is error prone.
If the tgz was renamed, for any reason, the update would fail.
This is easily noticeable with browser download:
duplicate downloads will have a (1) appended, causing a fail.
Choosing the first subdir of the tgz is sufficient.
  • Loading branch information
Willy-JL authored Mar 27, 2023
1 parent 2296135 commit 0bcc9ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/flipperzero/toplevel/fullupdateoperation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ bool FullUpdateOperation::findAndCdToUpdateDir()
const auto &fileInfo = it.fileInfo();
const auto fileName = fileInfo.fileName();

if(fileInfo.isDir() && m_updateDirectory.dirName().endsWith(fileName)) {
if(fileInfo.isDir()) {
m_updateDirectory.cd(fileName);
return true;
}
Expand Down

0 comments on commit 0bcc9ed

Please sign in to comment.