refactor: remove util.promisify calls

This commit is contained in:
Barış Soner Uşaklı
2020-08-14 00:05:03 -04:00
parent 45c8de129c
commit 0189945996
18 changed files with 50 additions and 108 deletions

View File

@@ -4,9 +4,6 @@ require('colors');
const path = require('path');
const winston = require('winston');
const fs = require('fs');
const util = require('util');
const fsAccessAsync = util.promisify(fs.access);
const db = require('../database');
const events = require('../events');
@@ -100,7 +97,7 @@ async function resetSettings() {
async function resetTheme(themeId) {
try {
await fsAccessAsync(path.join(dirname, 'node_modules', themeId, 'package.json'));
await fs.promises.access(path.join(dirname, 'node_modules', themeId, 'package.json'));
} catch (err) {
winston.warn('[reset] Theme `%s` is not installed on this forum', themeId);
throw new Error('theme-not-found');