2020-02-03 10:24:25 +01:00
|
|
|
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
|
|
|
|
2020-02-03 10:24:25 +01:00
|
|
|
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-03 10:24:25 +01:00
|
|
|
try {
|
|
|
|
await mkdir("./output")
|
|
|
|
} catch (e) {}
|
2019-06-07 15:18:10 +02:00
|
|
|
|
2020-02-03 10:24:25 +01:00
|
|
|
for (let type in config) {
|
|
|
|
await mkdir(join("output", type))
|
|
|
|
}
|
2019-06-07 15:18:10 +02:00
|
|
|
|
2020-02-03 10:24:25 +01:00
|
|
|
await mkdir("./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
|