2020-02-03 10:24:25 +01:00
|
|
|
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 () => {
|
2020-02-03 10:24:25 +01:00
|
|
|
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
|
|
|
|
2020-02-03 10:24:25 +01:00
|
|
|
for (let type in config) {
|
2020-02-25 16:21:23 +01:00
|
|
|
await mkdirp(join("output", type))
|
2020-02-03 10:24:25 +01:00
|
|
|
}
|
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
|
|
|
|
2020-02-03 10:24:25 +01:00
|
|
|
return config
|
|
|
|
}
|
2019-06-07 15:18:10 +02:00
|
|
|
|
2020-02-03 10:24:25 +01:00
|
|
|
export default getConfig
|