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

Update compileAndDeploy.js, use join for path's in compile #379

Merged
merged 1 commit into from
Mar 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion test/helpers/contract/compileAndDeploy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const solc = require("solc");
const { readFileSync } = require("fs");
const { join } = require("path");

/**
* Compile the specified contract(s)
Expand All @@ -13,7 +14,7 @@ async function compile(mainContractName, contractFileNames = [], contractPath) {

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