1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-12-29 19:54:34 +03:00
leon/scripts/setup/setup.js

42 lines
1.2 KiB
JavaScript
Raw Normal View History

import { LoaderHelper } from '@/helpers/loader-helper'
import { LogHelper } from '@/helpers/log-helper'
2019-02-10 15:26:50 +03:00
import train from '../train/train'
2023-04-27 15:24:16 +03:00
import generateHTTPAPIKey from '../generate/generate-http-api-key'
import generateJSONSchemas from '../generate/generate-json-schemas'
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'
import installNodeJSSkillsPackages from './install-nodejs-skills-packages'
2023-04-30 18:39:39 +03:00
import setupBinaries from './setup-binaries'
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()
LoaderHelper.start()
2022-10-22 20:00:55 +03:00
await Promise.all([setupCore(), setupSkillsConfig()])
await installNodeJSSkillsPackages()
LoaderHelper.stop()
2023-04-30 18:39:39 +03:00
await setupBinaries()
2023-04-27 15:24:16 +03:00
await generateHTTPAPIKey()
await generateJSONSchemas()
LoaderHelper.start()
2019-02-10 15:26:50 +03:00
await train()
await createInstanceID()
2019-02-10 15:26:50 +03:00
LogHelper.default('')
LogHelper.success('Hooray! Leon is installed and ready to go!')
LoaderHelper.stop()
2019-02-10 15:26:50 +03:00
} catch (e) {
LogHelper.error(e)
LoaderHelper.stop()
2019-02-10 15:26:50 +03:00
}
})()