aboutsummaryrefslogtreecommitdiffstats
path: root/packages/deployer/src/commands.ts
blob: d1707c5ed444f7bde0f34626a3d82bb08b79c746 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { Compiler } from './compiler';
import { Deployer } from './deployer';
import { migrator } from './migrations/migrate';
import { CompilerOptions, DeployerOptions } from './utils/types';

export const commands = {
    async compileAsync(opts: CompilerOptions): Promise<void> {
        const compiler = new Compiler(opts);
        await compiler.compileAllAsync();
    },
    async migrateAsync(opts: DeployerOptions): Promise<void> {
        const deployer = new Deployer(opts);
        await migrator.runMigrationsAsync(deployer);
    },
    async deployAsync(contractName: string, args: any[], opts: DeployerOptions): Promise<void> {
        const deployer = new Deployer(opts);
        await deployer.deployAndSaveAsync(contractName, args);
    },
};