Introduce isCompilerAvailableLocally
This commit is contained in:
@@ -191,7 +191,8 @@ export class Compiler {
|
|||||||
const fullSolcVersion = binPaths[contractSpecificSourceData.solcVersion];
|
const fullSolcVersion = binPaths[contractSpecificSourceData.solcVersion];
|
||||||
const compilerBinFilename = path.join(__dirname, '../../solc_bin', fullSolcVersion);
|
const compilerBinFilename = path.join(__dirname, '../../solc_bin', fullSolcVersion);
|
||||||
let solcjs: string;
|
let solcjs: string;
|
||||||
if (fs.existsSync(compilerBinFilename)) {
|
const isCompilerAvailableLocally = fs.existsSync(compilerBinFilename);
|
||||||
|
if (isCompilerAvailableLocally) {
|
||||||
solcjs = fs.readFileSync(compilerBinFilename).toString();
|
solcjs = fs.readFileSync(compilerBinFilename).toString();
|
||||||
} else {
|
} else {
|
||||||
utils.consoleLog(`Downloading ${fullSolcVersion}...`);
|
utils.consoleLog(`Downloading ${fullSolcVersion}...`);
|
||||||
|
|||||||
Reference in New Issue
Block a user