From 0f1589a43f610a79f46fa4c3412670b546b032af Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 7 May 2018 13:37:21 +0200 Subject: Define a separator const --- packages/deployer/src/cli.ts | 7 ++++--- packages/deployer/src/compiler.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'packages/deployer/src') diff --git a/packages/deployer/src/cli.ts b/packages/deployer/src/cli.ts index b06168e31..5df9f9963 100644 --- a/packages/deployer/src/cli.ts +++ b/packages/deployer/src/cli.ts @@ -19,6 +19,7 @@ const DEFAULT_NETWORK_ID = 50; const DEFAULT_JSONRPC_URL = 'http://localhost:8545'; const DEFAULT_GAS_PRICE = (10 ** 9 * 2).toString(); const DEFAULT_CONTRACTS_LIST = '*'; +const SEPARATOR = ','; /** * Compiles all contracts with options passed in through CLI. @@ -28,7 +29,7 @@ async function onCompileCommandAsync(argv: CliOptions): Promise { const opts: CompilerOptions = { contractsDir: argv.contractsDir, artifactsDir: argv.artifactsDir, - contracts: argv.contracts === '*' ? argv.contracts : argv.contracts.split(','), + contracts: argv.contracts === DEFAULT_CONTRACTS_LIST ? DEFAULT_CONTRACTS_LIST : argv.contracts.split(SEPARATOR), }; await commands.compileAsync(opts); } @@ -44,7 +45,7 @@ async function onDeployCommandAsync(argv: CliOptions): Promise { const compilerOpts: CompilerOptions = { contractsDir: argv.contractsDir, artifactsDir: argv.artifactsDir, - contracts: argv.contracts === '*' ? argv.contracts : argv.contracts.split(','), + contracts: argv.contracts === DEFAULT_CONTRACTS_LIST ? DEFAULT_CONTRACTS_LIST : argv.contracts.split(SEPARATOR), }; await commands.compileAsync(compilerOpts); @@ -59,7 +60,7 @@ async function onDeployCommandAsync(argv: CliOptions): Promise { defaults, }; const deployerArgsString = argv.args as string; - const deployerArgs = deployerArgsString.split(','); + const deployerArgs = deployerArgsString.split(SEPARATOR); await commands.deployAsync(argv.contract as string, deployerArgs, deployerOpts); } /** diff --git a/packages/deployer/src/compiler.ts b/packages/deployer/src/compiler.ts index 673bc3186..85449ac8d 100644 --- a/packages/deployer/src/compiler.ts +++ b/packages/deployer/src/compiler.ts @@ -53,7 +53,7 @@ const DEFAULT_COMPILER_SETTINGS: solc.CompilerSettings = { }, outputSelection: { '*': { - '*': ['abi', 'evm.bytecode.object'], + [ALL_CONTRACTS_IDENTIFIER]: ['abi', 'evm.bytecode.object'], }, }, }; -- cgit v1.2.3