diff --git a/.all-contributorsrc b/.all-contributorsrc index 2fcf444..0fefa77 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1,26 +1,26 @@ { - "projectOwner": "jfmengels" -, "projectName": "all-contributors-cli" -, "imageSize": 100 -, "commit": true -, "contributors": [ + "projectOwner": "jfmengels", + "projectName": "all-contributors-cli", + "imageSize": 100, + "commit": true, + "contributors": [ { - "login": "jfmengels" - , "name": "Jeroen Engels" - , "avatar_url": "https://avatars.githubusercontent.com/u/3869412?v=3" - , "profile": "https://github.com/jfmengels" - , "contributions": [ - "code" - , "doc" - , "test" + "login": "jfmengels", + "name": "Jeroen Engels", + "avatar_url": "https://avatars.githubusercontent.com/u/3869412?v=3", + "profile": "https://github.com/jfmengels", + "contributions": [ + "code", + "doc", + "test" ] - } - , { - "login": "kentcdodds" - , "name": "Kent C. Dodds" - , "avatar_url": "https://avatars.githubusercontent.com/u/1500684?v=3" - , "profile": "http://kentcdodds.com/" - , "contributions": [ + }, + { + "login": "kentcdodds", + "name": "Kent C. Dodds", + "avatar_url": "https://avatars.githubusercontent.com/u/1500684?v=3", + "profile": "http://kentcdodds.com/", + "contributions": [ "doc" ] } diff --git a/lib/util/configFile.js b/lib/util/configFile.js index fbe2265..8879866 100644 --- a/lib/util/configFile.js +++ b/lib/util/configFile.js @@ -3,28 +3,18 @@ var fs = require('fs'); var _ = require('lodash/fp'); -function formatCommaFirst(o) { - return JSON.stringify(o, null, 2) - .split(/(,\n\s+)/) - .map(function (e, i) { - return i % 2 ? '\n' + e.substring(4) + ', ' : e; - }) - .join('') + - '\n'; -} - function readConfig(configPath) { return JSON.parse(fs.readFileSync(configPath, 'utf-8')); } function writeConfig(configPath, content, cb) { - return fs.writeFile(configPath, formatCommaFirst(content), cb); + return fs.writeFile(configPath, JSON.stringify(content, null, 2), cb); } function writeContributors(configPath, contributors, cb) { var config = readConfig(configPath); var content = _.assign(config, {contributors: contributors}); - return fs.writeFile(configPath, formatCommaFirst(content), cb); + return fs.writeFile(configPath, JSON.stringify(content, null, 2), cb); } module.exports = {