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