fix lint errors
This commit is contained in:
parent
74f7cd6e31
commit
30ff29afc7
|
|
@ -11,14 +11,14 @@ import { postgresMigrations } from './database/migrations/postgres'
|
||||||
let appDataSource: DataSource
|
let appDataSource: DataSource
|
||||||
|
|
||||||
export const init = async (): Promise<void> => {
|
export const init = async (): Promise<void> => {
|
||||||
let homePath;
|
let homePath
|
||||||
let flowisePath = path.join(getUserHome(), '.flowise');
|
let flowisePath = path.join(getUserHome(), '.flowise')
|
||||||
if (!fs.existsSync(flowisePath)) {
|
if (!fs.existsSync(flowisePath)) {
|
||||||
fs.mkdirSync(flowisePath);
|
fs.mkdirSync(flowisePath)
|
||||||
}
|
}
|
||||||
switch (process.env.DATABASE_TYPE) {
|
switch (process.env.DATABASE_TYPE) {
|
||||||
case 'sqlite':
|
case 'sqlite':
|
||||||
homePath = process.env.DATABASE_PATH ?? flowisePath;
|
homePath = process.env.DATABASE_PATH ?? flowisePath
|
||||||
appDataSource = new DataSource({
|
appDataSource = new DataSource({
|
||||||
type: 'sqlite',
|
type: 'sqlite',
|
||||||
database: path.resolve(homePath, 'database.sqlite'),
|
database: path.resolve(homePath, 'database.sqlite'),
|
||||||
|
|
@ -59,7 +59,7 @@ export const init = async (): Promise<void> => {
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
homePath = process.env.DATABASE_PATH ?? flowisePath;
|
homePath = process.env.DATABASE_PATH ?? flowisePath
|
||||||
appDataSource = new DataSource({
|
appDataSource = new DataSource({
|
||||||
type: 'sqlite',
|
type: 'sqlite',
|
||||||
database: path.resolve(homePath, 'database.sqlite'),
|
database: path.resolve(homePath, 'database.sqlite'),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue