Tidy up some file related calls

This commit is contained in:
jliddev
2020-10-25 00:35:24 -05:00
parent 185f93c951
commit 0d515dc310
3 changed files with 6 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -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];

View File

@@ -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);
}
}