ref: 优化window读取系统应用

This commit is contained in:
muwoo 2021-09-09 11:44:17 +08:00
parent d047119076
commit 9242f17cde
2 changed files with 8 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "rubick2",
"version": "0.0.4",
"version": "0.0.5",
"author": "muwoo <2424880409@qq.com>",
"description": "An electron-vue project",
"license": null,

View File

@ -17,7 +17,13 @@ const getico = app =>{
try {
const buffer = fileIcon(app.desc, 32);
const iconpath = path.join(icondir, `${app.name}.png`);
fs.writeFileSync(iconpath, buffer, 'base64');
fs.exists(iconpath, exists => {
if (!exists) {
fs.writeFile(iconpath, buffer, 'base64', () => {});
}
});
} catch(e) {
console.log(e, app.desc);
}