mirror of
https://github.com/WowUp/WowUp.git
synced 2026-04-24 15:57:19 -04:00
Tidy up some file related calls
This commit is contained in:
@@ -86,7 +86,9 @@ export class IpcHandler {
|
||||
try {
|
||||
await fs.access(filePath);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
if (e.code !== "ENOENT") {
|
||||
console.error(e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -435,7 +435,7 @@ export class AddonService {
|
||||
const provider = this.getProvider(providerName);
|
||||
return provider.getById(externalId, clientType).pipe(
|
||||
map((searchResult) => {
|
||||
console.log("SEARCH RES", searchResult);
|
||||
console.debug("SEARCH RES", searchResult);
|
||||
let latestFile = this.getLatestFile(searchResult, targetAddonChannel);
|
||||
if (!latestFile) {
|
||||
latestFile = searchResult.files[0];
|
||||
|
||||
@@ -88,7 +88,8 @@ export class FileService {
|
||||
}
|
||||
|
||||
public async deleteIfExists(filePath: string) {
|
||||
if (await this.pathExists(filePath)) {
|
||||
const pathExists = await this.pathExists(filePath);
|
||||
if (pathExists) {
|
||||
await this.remove(filePath);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user