Skip to content

Commit

Permalink
Fixed local icons and removed electron-rebuild dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
cbartondock committed Nov 4, 2021
1 parent b653e49 commit 22491d0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 28 deletions.
25 changes: 1 addition & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"url": "https://github.com/doZennn/steam-rom-manager"
},
"scripts": {
"rebuild": "electron-rebuild",
"postinstall": "electron-builder install-app-deps",
"validate-files": "ts-node ./.validate-files.ts",
"start": "electron ./dist/main.bundle.js",
Expand Down Expand Up @@ -146,7 +145,6 @@
"css-loader": "^6.5.0",
"electron": "^9.0.3",
"electron-builder": "^21.2.0",
"electron-rebuild": "^1.8.8",
"html-loader": "^3.0.0",
"html-webpack-plugin": "^5.5.0",
"mini-css-extract-plugin": "^2.4.3",
Expand Down
9 changes: 7 additions & 2 deletions src/lib/file-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,12 +401,17 @@ export class FileParser {
});
}
}));
let iconextRegex = /png|ico|exe|jpg|jpeg/i
localIconPromises.push(this.resolveFieldGlobs('localIcons', configs[i],settings, parsedConfigs[i], vParser).then((data) => {
for (let j = 0; j < data.parsedConfig.files.length; j++) {
data.parsedConfig.files[j].resolvedLocalIcons = data.resolvedGlobs[j];
data.parsedConfig.files[j].localIcons = data.resolvedFiles[j];
data.parsedConfig.files[j].localIcons = data.resolvedFiles[j].filter((item)=>{
return iconextRegex.test(path.extname(item));
}).map((item)=> {
return url.encodeFile(item);
});
if(isEpicParser) {
data.parsedConfig.files[j].localIcons.push(data.parsedConfig.files[j].filePath)
data.parsedConfig.files[j].localIcons.push(url.encodeFile(data.parsedConfig.files[j].filePath))
}
}
}));
Expand Down

0 comments on commit 22491d0

Please sign in to comment.