Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
}
}
}
if (spinner) {
spinner.stopAndPersist()
}
spinner = ora({ interval: 120 })
logInstall(list, spinner, dev)
})
/**
* Commit mutations
*/
const response = await pkg.commitAsync()
spinner && spinner!.stopAndPersist()
if (response && response.status === 1) {
const errorMessage = state.client === 'yarn' ? 'yarn install failed' : 'npm install failed'
logger.fatal({ message: errorMessage, stack: response.stderr.toString() })
throw new Error('Installation failed')
} else {
logger.create('package.json')
}
}
* Print logs and filter out duplicate one's
*/
logger.resumeLogger((message) => {
if (LOG_MESSAGES.has(message.message as string) && message.action !== 'fatal') {
return false
}
LOG_MESSAGES.add(message.message as string)
return true
})
/**
* Handle error
*/
if (instructionsError) {
logger.fatal(instructionsError)
throw instructionsError
}
}