mirror of
https://github.com/RamonGebben/mergify.git
synced 2026-03-10 08:51:18 +00:00
16 lines
401 B
JavaScript
16 lines
401 B
JavaScript
const { writeFile } = require('fs');
|
|
const { promisify } = require('util');
|
|
const writeFileAsync = promisify(writeFile);
|
|
const { getConfigPath } = require('../getConfigPath');
|
|
|
|
async function writeConfig(config) {
|
|
config.userId = parseInt(config.userId);
|
|
|
|
const body = JSON.stringify(config, null, 2);
|
|
return writeFileAsync(getConfigPath(), body, 'utf8');
|
|
}
|
|
|
|
module.exports = {
|
|
writeConfig
|
|
};
|