aboutsummaryrefslogblamecommitdiffstats
path: root/packages/deployer/src/commands.ts
blob: 2acef8e8f49c1bb3651440e7656db59492117a36 (plain) (tree)
1
2
3
4
                                                


                                                                 














                                                                                                
import { migrator } from './migrations/migrate';
import { Compiler } from './compiler';
import { Deployer } from './deployer';
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);
    },
};