aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorF. Eugene Aumson <gene@aumson.org>2018-08-23 05:47:40 +0800
committerF. Eugene Aumson <gene@aumson.org>2018-08-29 02:24:26 +0800
commit5c056b57b7c16c2c7a27143dcfd1e7a340a191a9 (patch)
tree9abcf0bacae482ae9219d0edef0ec57b04fe889d
parent4779ebfd20d9c4b197d525453ac1ec47cc15e2bc (diff)
downloaddexon-sol-tools-5c056b57b7c16c2c7a27143dcfd1e7a340a191a9.tar
dexon-sol-tools-5c056b57b7c16c2c7a27143dcfd1e7a340a191a9.tar.gz
dexon-sol-tools-5c056b57b7c16c2c7a27143dcfd1e7a340a191a9.tar.bz2
dexon-sol-tools-5c056b57b7c16c2c7a27143dcfd1e7a340a191a9.tar.lz
dexon-sol-tools-5c056b57b7c16c2c7a27143dcfd1e7a340a191a9.tar.xz
dexon-sol-tools-5c056b57b7c16c2c7a27143dcfd1e7a340a191a9.tar.zst
dexon-sol-tools-5c056b57b7c16c2c7a27143dcfd1e7a340a191a9.zip
extract method _getContractNamesToCompile()
-rw-r--r--packages/sol-compiler/src/compiler.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts
index c44585a36..bc6243a8f 100644
--- a/packages/sol-compiler/src/compiler.ts
+++ b/packages/sol-compiler/src/compiler.ts
@@ -159,16 +159,17 @@ export class Compiler {
public async compileAsync(): Promise<void> {
await createDirIfDoesNotExistAsync(this._artifactsDir);
await createDirIfDoesNotExistAsync(SOLC_BIN_DIR);
- let contractNamesToCompile: string[] = [];
+ await this._compileContractsAsync(this._getContractNamesToCompile());
+ }
+ private _getContractNamesToCompile(): string[] {
if (this._specifiedContracts === ALL_CONTRACTS_IDENTIFIER) {
const allContracts = this._nameResolver.getAll();
- contractNamesToCompile = _.map(allContracts, contractSource =>
+ return _.map(allContracts, contractSource =>
path.basename(contractSource.path, constants.SOLIDITY_FILE_EXTENSION),
);
} else {
- contractNamesToCompile = this._specifiedContracts;
+ return this._specifiedContracts;
}
- await this._compileContractsAsync(contractNamesToCompile);
}
/**
* Compiles contract and saves artifact to artifactsDir.