import { resolveRoot } from './resolveRoot'
import { join } from 'path'
import * as fs from 'fs'

export function resolveDatabases() {
	let databasesFolder: string
	if (process.env.NODE_ENV === 'development') {
		databasesFolder = join(resolveRoot(), 'databases')
	} else {
		databasesFolder = join(resolveRoot(), '..', 'databases')
	}

	if (!fs.existsSync(databasesFolder)) {
		fs.mkdirSync(databasesFolder)
	}

	return databasesFolder
}

import { resolveRoot } from './resolveRoot'
import { join } from 'path'

export function resolveDatabases() {
	if (process.env.NODE_ENV === 'development') {
		return join(resolveRoot(), 'databases')
	} else {
		return join(resolveRoot(), '..', 'databases')
	}
}

--- 
+++ 
@@ -1,10 +1,18 @@
 import { resolveRoot } from './resolveRoot'
 import { join } from 'path'
+import * as fs from 'fs'
 
 export function resolveDatabases() {
+	let databasesFolder: string
 	if (process.env.NODE_ENV === 'development') {
-		return join(resolveRoot(), 'databases')
+		databasesFolder = join(resolveRoot(), 'databases')
 	} else {
-		return join(resolveRoot(), '..', 'databases')
+		databasesFolder = join(resolveRoot(), '..', 'databases')
 	}
+
+	if (!fs.existsSync(databasesFolder)) {
+		fs.mkdirSync(databasesFolder)
+	}
+
+	return databasesFolder
 }
Create db folder in none
