From 8eabc49e9d17925d5cce92cf9e1b3d65ba875f2d Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 7 May 2018 14:06:00 +0200 Subject: Introduce a var --- packages/sol-resolver/src/resolvers/name_resolver.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'packages/sol-resolver/src/resolvers') diff --git a/packages/sol-resolver/src/resolvers/name_resolver.ts b/packages/sol-resolver/src/resolvers/name_resolver.ts index a0bedab98..76bed802e 100644 --- a/packages/sol-resolver/src/resolvers/name_resolver.ts +++ b/packages/sol-resolver/src/resolvers/name_resolver.ts @@ -18,7 +18,8 @@ export class NameResolver extends EnumerableResolver { const onFile = (filePath: string) => { const contractName = path.basename(filePath, SOLIDITY_FILE_EXTENSION); if (contractName === lookupContractName) { - const source = fs.readFileSync(path.join(this._contractsDir, filePath)).toString(); + const absoluteContractPath = path.join(this._contractsDir, filePath); + const source = fs.readFileSync(absoluteContractPath).toString(); contractSource = { source, path: filePath, @@ -35,7 +36,8 @@ export class NameResolver extends EnumerableResolver { const contractSources: ContractSource[] = []; const onFile = (filePath: string) => { const contractName = path.basename(filePath, SOLIDITY_FILE_EXTENSION); - const source = fs.readFileSync(path.join(this._contractsDir, filePath)).toString(); + const absoluteContractPath = path.join(this._contractsDir, filePath); + const source = fs.readFileSync(absoluteContractPath).toString(); const contractSource = { source, path: filePath, -- cgit