budibase/packages/datastores/config.template.js

30 lines
482 B
JavaScript
Raw Normal View History

import fs from "fs"
import { mkdir } from "fs"
import { join } from "path"
import { promisify } from "es6-promisify"
2019-06-07 15:18:10 +02:00
mkdirp = promisify(mkdir)
2019-06-07 15:18:10 +02:00
const getConfig = async () => {
const config = {
local: {
root: "./output/local/files",
},
memory: {},
}
2019-06-07 15:18:10 +02:00
try {
await mkdir("./output")
} catch (e) {}
2019-06-07 15:18:10 +02:00
for (let type in config) {
await mkdir(join("output", type))
}
2019-06-07 15:18:10 +02:00
await mkdir("./output/local/files")
2019-06-07 15:18:10 +02:00
return config
}
2019-06-07 15:18:10 +02:00
export default getConfig