diff options
Diffstat (limited to 'packages/contracts/deploy')
-rw-r--r-- | packages/contracts/deploy/cli.ts | 15 | ||||
-rw-r--r-- | packages/contracts/deploy/src/utils/types.ts | 3 |
2 files changed, 10 insertions, 8 deletions
diff --git a/packages/contracts/deploy/cli.ts b/packages/contracts/deploy/cli.ts index 423523e21..b02849826 100644 --- a/packages/contracts/deploy/cli.ts +++ b/packages/contracts/deploy/cli.ts @@ -23,12 +23,12 @@ const DEFAULT_GAS_PRICE = ((10 ** 9) * 2).toString(); * Compiles all contracts with options passed in through CLI. * @param argv Instance of process.argv provided by yargs. */ -async function onCompileCommand(args: CliOptions): Promise<void> { +async function onCompileCommand(argv: CliOptions): Promise<void> { const opts: CompilerOptions = { - contractsDir: args.contractsDir, - networkId: args.networkId, - optimizerEnabled: args.shouldOptimize ? 1 : 0, - artifactsDir: args.artifactsDir, + contractsDir: argv.contractsDir, + networkId: argv.networkId, + optimizerEnabled: argv.shouldOptimize ? 1 : 0, + artifactsDir: argv.artifactsDir, }; await commands.compileAsync(opts); } @@ -113,6 +113,7 @@ function deployCommandBuilder(yargsInstance: any) { } (() => { + const identityCommandBuilder = _.identity; return yargs .option('contracts-dir', { type: 'string', @@ -150,11 +151,11 @@ function deployCommandBuilder(yargsInstance: any) { }) .command('compile', 'compile contracts', - _.noop, + identityCommandBuilder, onCompileCommand) .command('migrate', 'compile and deploy contracts using migration scripts', - _.noop, + identityCommandBuilder, onMigrateCommand) .command('deploy', 'deploy a single contract with provided arguments', diff --git a/packages/contracts/deploy/src/utils/types.ts b/packages/contracts/deploy/src/utils/types.ts index f6b9de6e9..6831079e6 100644 --- a/packages/contracts/deploy/src/utils/types.ts +++ b/packages/contracts/deploy/src/utils/types.ts @@ -1,5 +1,6 @@ import {TxData} from '@0xproject/types'; import * as Web3 from 'web3'; +import * as yargs from 'yargs'; export enum AbiType { Function = 'function', @@ -32,7 +33,7 @@ export interface SolcErrors { [key: string]: boolean; } -export interface CliOptions { +export interface CliOptions extends yargs.Arguments { artifactsDir: string; contractsDir: string; jsonrpcPort: number; |