diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts index 940b260879..3d6f348a48 100644 --- a/packages/sol-compiler/src/compiler.ts +++ b/packages/sol-compiler/src/compiler.ts @@ -19,6 +19,7 @@ import * as path from 'path'; import * as pluralize from 'pluralize'; import * as semver from 'semver'; import { StandardInput } from 'solc'; +import { promisify } from 'util'; import { compilerOptionsSchema } from './schemas/compiler_options_schema'; import { @@ -91,8 +92,8 @@ export class Compiler { file: string = 'compiler.json', ): Promise { // TODO: Look for config file in parent directories if not found in current directory - const fileConfig: CompilerOptions = (await fs.promises.stat(file)).isFile - ? JSON.parse((await fs.promises.readFile(file, 'utf8')).toString()) + const fileConfig: CompilerOptions = (await promisify(fs.stat)(file)).isFile + ? JSON.parse((await promisify(fs.readFile)(file, 'utf8')).toString()) : {}; assert.doesConformToSchema('compiler.json', fileConfig, compilerOptionsSchema); return {