module . exports = async function ( context ) { const { parameters , ignite , print , strings } = context ; const { pascalCase , isBlank } = strings ; const config = ignite . loadIgniteConfig ( ) ; const { tests } = config ; if ( isBlank ( parameters . first ) ) { print . info ( `${ context . runtime . brand } generate saga <name>\n` ) ; print . info ( 'A name is required.' ) ; return ; } const name = pascalCase ( parameters . first ) ; const props = { name } ; const jobs = [ { template : `saga.ejs` , target : `App/Sagas/${ name }Sagas/index.ts` } ] ; if ( tests ) { jobs . push ( { template : `saga-test-${ tests }.ejs` , target : `App/Sagas/${ name }Sagas/${ name }SagaTest.ts` } ) ; } await ignite . copyBatch ( context , jobs , props ) ; } ;