Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Update compileAndDeploy.js, use join for path's in compile (#379)
Browse files Browse the repository at this point in the history
Sometimes it makes sense in a test to use compile or compileAndDeploy.
This updates these functions with path.join to better handle path concat
  • Loading branch information
nicholasjpaterno authored and davidmurdoch committed Mar 21, 2019
1 parent d9f5e68 commit fb46a3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/helpers/contract/compileAndDeploy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const solc = require("solc");
const { join } = require("path");
const { readFileSync } = require("fs");
const { join } = require("path");

/**
* Compile the specified contract(s)
Expand All @@ -15,7 +16,7 @@ function compile(mainContractName, contractFileNames = [], contractSubdirectory)

const contractSources = selectedContracts.map((contractName) => {
const _contractName = `${contractName.replace(/\.sol$/i, "")}.sol`;
return { [_contractName]: readFileSync(`${contractPath}${_contractName}`, "utf8") };
return { [_contractName]: readFileSync(join(contractPath, _contractName), "utf8") };
});

const sources = Object.assign({}, ...contractSources);
Expand Down

0 comments on commit fb46a3e

Please sign in to comment.