2022-09-26 16:24:07 +03:00
|
|
|
import { LoaderHelper } from '@/helpers/loader-helper'
|
2022-09-26 16:29:56 +03:00
|
|
|
import { LogHelper } from '@/helpers/log-helper'
|
2019-02-10 15:26:50 +03:00
|
|
|
|
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'
|
2023-01-06 23:18:19 +03:00
|
|
|
import generateJsonSchemas from '../generate/generate-json-schemas'
|
2022-09-26 19:01:03 +03:00
|
|
|
|
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'
|
2022-10-22 18:22:50 +03:00
|
|
|
import setupPythonBinaries from './setup-python-binaries'
|
2023-04-12 19:11:23 +03:00
|
|
|
import createInstanceID from './create-instance-id'
|
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 {
|
|
|
|
await setupDotenv()
|
2022-09-26 16:24:07 +03:00
|
|
|
LoaderHelper.start()
|
2022-10-22 20:00:55 +03:00
|
|
|
await Promise.all([setupCore(), setupSkillsConfig()])
|
2022-09-26 16:24:07 +03:00
|
|
|
LoaderHelper.stop()
|
2022-10-22 20:00:55 +03:00
|
|
|
await setupPythonBinaries()
|
2022-01-16 17:22:49 +03:00
|
|
|
await generateHttpApiKey()
|
2023-01-06 23:18:19 +03:00
|
|
|
await generateJsonSchemas()
|
2022-09-26 16:24:07 +03:00
|
|
|
LoaderHelper.start()
|
2019-02-10 15:26:50 +03:00
|
|
|
await train()
|
2023-04-12 19:11:23 +03:00
|
|
|
await createInstanceID()
|
2019-02-10 15:26:50 +03:00
|
|
|
|
2022-09-26 16:29:56 +03:00
|
|
|
LogHelper.default('')
|
|
|
|
LogHelper.success('Hooray! Leon is installed and ready to go!')
|
2022-09-26 16:24:07 +03:00
|
|
|
LoaderHelper.stop()
|
2019-02-10 15:26:50 +03:00
|
|
|
} catch (e) {
|
2022-09-26 16:29:56 +03:00
|
|
|
LogHelper.error(e)
|
2022-09-26 16:24:07 +03:00
|
|
|
LoaderHelper.stop()
|
2019-02-10 15:26:50 +03:00
|
|
|
}
|
|
|
|
})()
|