Skip to content

Commit

Permalink
Xiaomi/Aqara OTA-firmware (Koenkk#38)
Browse files Browse the repository at this point in the history
* fix for relative path (for windows). no throw error when no file.

Co-authored-by: Киров Илья <[email protected]>
  • Loading branch information
kirovilya and Киров Илья authored Apr 6, 2021
1 parent 41b4f68 commit c97b398
Show file tree
Hide file tree
Showing 41 changed files with 399 additions and 1 deletion.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added images/Xiaomi/lumi.light.aqcn02_32.ota
Binary file not shown.
Binary file not shown.
390 changes: 390 additions & 0 deletions index.json

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion scripts/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const manufacturerNameLookup = {
4678: 'Danfoss',
4687: 'Gledopto',
4919: 'Datek',
4447: 'Xiaomi',
};

const main = async () => {
Expand Down Expand Up @@ -99,7 +100,14 @@ const main = async () => {
indexJSON[index] = entry;

if (entry.path && entry.path !== destination) {
fs.unlinkSync(entry.path);
try {
fs.unlinkSync(path.resolve(entry.path));
} catch (err) {
if (err && err.code != 'ENOENT') {
console.error("Error in call to fs.unlink", err);
throw err;
}
}
}
} else {
console.log(`Added new entry (${JSON.stringify(entry)})`);
Expand Down

0 comments on commit c97b398

Please sign in to comment.