Introduce isCompilerAvailableLocally

This commit is contained in:
Leonid Logvinov
2018-03-09 15:28:31 +01:00
parent 3787e4a83c
commit 2c501d2380

View File

@@ -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}...`);