Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
@0x/sol-compiler: remove fs.promises usage
Browse files Browse the repository at this point in the history
  • Loading branch information
dorothy-zbornak committed Mar 30, 2020
1 parent 0487047 commit e322fab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/sol-compiler/src/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -91,8 +92,8 @@ export class Compiler {
file: string = 'compiler.json',
): Promise<CompilerOptions> {
// 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 {
Expand Down

0 comments on commit e322fab

Please sign in to comment.