mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 14:11:50 +00:00
Small cleanup
This commit is contained in:
parent
7c39454a9d
commit
ee3a64cafa
1 changed files with 5 additions and 5 deletions
10
src/index.ts
10
src/index.ts
|
@ -1,10 +1,10 @@
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import yaml from "js-yaml";
|
import yaml from "js-yaml";
|
||||||
|
|
||||||
import _fs from "fs";
|
import fs from "fs";
|
||||||
const fs = _fs.promises;
|
const fsp = fs.promises;
|
||||||
|
|
||||||
import {Knub, logger, PluginError} from "knub";
|
import { Knub, logger, PluginError } from "knub";
|
||||||
import { SimpleError } from "./SimpleError";
|
import { SimpleError } from "./SimpleError";
|
||||||
|
|
||||||
require("dotenv").config();
|
require("dotenv").config();
|
||||||
|
@ -125,12 +125,12 @@ connect().then(async conn => {
|
||||||
const configPath = path.join("config", configFile);
|
const configPath = path.join("config", configFile);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await fs.access(configPath);
|
await fsp.access(configPath);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
const yamlString = await fs.readFile(configPath, { encoding: "utf8" });
|
const yamlString = await fsp.readFile(configPath, { encoding: "utf8" });
|
||||||
return yaml.safeLoad(yamlString);
|
return yaml.safeLoad(yamlString);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue