mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-09-29 20:56:23 +00:00
use path.join just to be sure
This commit is contained in:
parent
3d07b8e07c
commit
ffec1ade76
@ -15,6 +15,7 @@ limitations under the License.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
|
import * as path from "path";
|
||||||
import { load } from "js-yaml";
|
import { load } from "js-yaml";
|
||||||
import { MatrixClient } from "matrix-bot-sdk";
|
import { MatrixClient } from "matrix-bot-sdk";
|
||||||
|
|
||||||
@ -173,7 +174,7 @@ export function read(): IConfig {
|
|||||||
const config_dir = process.env.NODE_CONFIG_DIR || "./config";
|
const config_dir = process.env.NODE_CONFIG_DIR || "./config";
|
||||||
const config_file = `${process.env.NODE_ENV || "default"}.yaml`
|
const config_file = `${process.env.NODE_ENV || "default"}.yaml`
|
||||||
|
|
||||||
const content = fs.readFileSync(`${config_dir}/${config_file}`, "utf8");
|
const content = fs.readFileSync(path.join(config_dir, config_file), "utf8");
|
||||||
const parsed = load(content);
|
const parsed = load(content);
|
||||||
const config = {...defaultConfig, ...(parsed as object)} as IConfig;
|
const config = {...defaultConfig, ...(parsed as object)} as IConfig;
|
||||||
return config;
|
return config;
|
||||||
|
Loading…
Reference in New Issue
Block a user