mirror of
https://github.com/RamonGebben/mergify.git
synced 2026-03-10 08:51:18 +00:00
22 lines
458 B
JavaScript
22 lines
458 B
JavaScript
const { readFile } = require('fs');
|
|
const { promisify } = require('util');
|
|
const readFileAsync = promisify(readFile);
|
|
|
|
async function readConfig() {
|
|
const configFileName = `${process.cwd()}/.config`;
|
|
try {
|
|
const config = await readFileAsync(configFileName, 'utf8');
|
|
return JSON.parse(config);
|
|
} catch(_) {
|
|
console.log(`
|
|
Oh no, \`mergify\` is not configured yet.
|
|
Let configure it
|
|
`);
|
|
return {};
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
readConfig
|
|
};
|