Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
process.exit(1)
}
}
/**
* Ensuring that defined path exists
*/
ensureDirSync(absPath)
if (!isEmptyDir(absPath)) {
const errors = [
`Cannot overwrite contents of {${projectRoot}} directory.`,
'Make sure to define path to an empty directory',
]
logger.error(errors.join(' '))
return
}
/**
* Set environment variables that can be used by the packages
* to tweak their setup behavior
*/
process.env['ADONIS_CREATE_APP_NAME'] = state.name
process.env['ADONIS_CREATE_ESLINT'] = String(state.eslint)
process.env['ADONIS_CREATE_APP_CLIENT'] = state.client
process.env['ADONIS_CREATE_APP_BOILERPLATE'] = state.boilerplate
/**
* Setup application
*/
const application = new Application(absPath, {} as any, {}, {})
*/
process.env['ADONIS_CREATE_APP_NAME'] = state.name
process.env['ADONIS_CREATE_ESLINT'] = String(state.eslint)
process.env['ADONIS_CREATE_APP_CLIENT'] = state.client
process.env['ADONIS_CREATE_APP_BOILERPLATE'] = state.boilerplate
/**
* Setup application
*/
const application = new Application(absPath, {} as any, {}, {})
for (let task of tasks) {
try {
await task(absPath, application, state)
} catch (err) {
logger.error('Unable to create new project. Rolling back')
logger.fatal(err)
removeSync(absPath)
return
}
}
}