2019-02-10 15:26:50 +03:00
|
|
|
import loader from '@/helpers/loader'
|
|
|
|
import log from '@/helpers/log'
|
|
|
|
|
2022-06-30 17:35:54 +03:00
|
|
|
import train from '../train/train'
|
2022-01-16 17:22:49 +03:00
|
|
|
import generateHttpApiKey from '../generate/generate-http-api-key'
|
2019-02-10 15:26:50 +03:00
|
|
|
import setupDotenv from './setup-dotenv'
|
|
|
|
import setupCore from './setup-core'
|
2022-02-16 16:08:47 +03:00
|
|
|
import setupSkillsConfig from './setup-skills-config'
|
2021-03-02 12:02:55 +03:00
|
|
|
import setupPythonPackages from './setup-python-packages'
|
2019-02-10 15:26:50 +03:00
|
|
|
|
|
|
|
// Do not load ".env" file because it is not created yet
|
|
|
|
|
|
|
|
/**
|
2022-09-04 09:25:05 +03:00
|
|
|
* Main entry to set up Leon
|
2019-02-10 15:26:50 +03:00
|
|
|
*/
|
2022-09-03 14:12:41 +03:00
|
|
|
;(async () => {
|
2019-02-10 15:26:50 +03:00
|
|
|
try {
|
|
|
|
// Required env vars to setup
|
|
|
|
process.env.PIPENV_PIPFILE = 'bridges/python/Pipfile'
|
|
|
|
process.env.PIPENV_VENV_IN_PROJECT = 'true'
|
|
|
|
|
|
|
|
await setupDotenv()
|
|
|
|
loader.start()
|
2022-09-03 14:12:41 +03:00
|
|
|
await Promise.all([setupCore(), setupSkillsConfig()])
|
2019-02-10 15:26:50 +03:00
|
|
|
await setupPythonPackages()
|
2022-01-16 17:22:49 +03:00
|
|
|
loader.stop()
|
|
|
|
await generateHttpApiKey()
|
|
|
|
loader.start()
|
2019-02-10 15:26:50 +03:00
|
|
|
await train()
|
|
|
|
|
|
|
|
log.default('')
|
|
|
|
log.success('Hooray! Leon is installed and ready to go!')
|
|
|
|
loader.stop()
|
|
|
|
} catch (e) {
|
|
|
|
log.error(e)
|
|
|
|
loader.stop()
|
|
|
|
}
|
|
|
|
})()
|