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')
	}
}

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
}

Create db folder in none
Create db folder in none
