// eslint-disable-next-line import/no-cycle import { nspawn as spawn, getCLIPath } from '..'; export const amplifyOverrideRoot = (cwd: string, settings: { testingWithLatestCodebase?: boolean }): Promise => { const args = ['override', 'project']; return spawn(getCLIPath(settings.testingWithLatestCodebase), args, { cwd, stripColors: true }) .wait('Do you want to edit override.ts file now?') .sendNo() .sendEof() .runAsync(); }; export const amplifyOverrideAuth = (cwd: string): Promise => { const args = ['override', 'auth']; return spawn(getCLIPath(), args, { cwd, stripColors: true }) .wait('Do you want to edit override.ts file now?') .sendNo() .sendEof() .runAsync(); }; export const amplifyOverrideApi = (cwd: string): Promise => { const args = ['override', 'api']; const chain = spawn(getCLIPath(), args, { cwd, stripColors: true }); chain.wait('Do you want to edit override.ts file now?').sendNo().sendEof(); return chain.runAsync(); }; export const buildOverrides = (cwd: string): Promise => { const args = ['build']; const chain = spawn(getCLIPath(), args, { cwd, stripColors: true }); return chain.runAsync(); };