budibase/packages/datastores/config.template.js

27 lines
444 B
JavaScript
Raw Normal View History

import { mkdir } from "fs"
import { join } from "path"
import { promisify } from "es6-promisify"
2019-06-07 15:18:10 +02:00
2020-02-25 16:21:23 +01:00
const 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
2020-02-25 16:21:23 +01:00
await mkdirp("./output")
2019-06-07 15:18:10 +02:00
for (let type in config) {
2020-02-25 16:21:23 +01:00
await mkdirp(join("output", type))
}
2019-06-07 15:18:10 +02:00
2020-02-25 16:21:23 +01:00
await mkdirp("./output/local/files")
2019-06-07 15:18:10 +02:00
return config
}
2019-06-07 15:18:10 +02:00
export default getConfig