From 6b8c7e1bdfa57fb56376fc9136819b97fd52b75a Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sun, 19 Jul 2020 13:35:54 +0300 Subject: [PATCH] Rename config.js to cfg.js So people don't accidentally edit the config source file rather than their own config file. --- knexfile.js | 2 +- src/bot.js | 2 +- src/{config.js => cfg.js} | 0 src/commands.js | 2 +- src/data/Thread.js | 2 +- src/data/attachments.js | 2 +- src/data/threads.js | 2 +- src/data/updates.js | 2 +- src/formatters.js | 2 +- src/index.js | 2 +- src/knex.js | 2 +- src/legacy/jsonDb.js | 2 +- src/legacy/legacyMigrator.js | 2 +- src/main.js | 2 +- src/modules/close.js | 2 +- src/modules/greeting.js | 2 +- src/modules/move.js | 2 +- src/modules/snippets.js | 2 +- src/modules/suspend.js | 2 +- src/modules/typingProxy.js | 2 +- src/modules/version.js | 2 +- src/modules/webserver.js | 2 +- src/utils.js | 2 +- 23 files changed, 22 insertions(+), 22 deletions(-) rename src/{config.js => cfg.js} (100%) diff --git a/knexfile.js b/knexfile.js index cf568f4..12606e3 100644 --- a/knexfile.js +++ b/knexfile.js @@ -1,2 +1,2 @@ -const config = require('./src/config'); +const config = require('./src/cfg'); module.exports = config.knex; diff --git a/src/bot.js b/src/bot.js index 2a1591a..41a37d9 100644 --- a/src/bot.js +++ b/src/bot.js @@ -1,5 +1,5 @@ const Eris = require('eris'); -const config = require('./config'); +const config = require('./cfg'); const bot = new Eris.Client(config.token, { getAllUsers: true, diff --git a/src/config.js b/src/cfg.js similarity index 100% rename from src/config.js rename to src/cfg.js diff --git a/src/commands.js b/src/commands.js index 59c6506..1973638 100644 --- a/src/commands.js +++ b/src/commands.js @@ -1,5 +1,5 @@ const { CommandManager, defaultParameterTypes, TypeConversionError } = require('knub-command-manager'); -const config = require('./config'); +const config = require('./cfg'); const utils = require('./utils'); const threads = require('./data/threads'); diff --git a/src/data/Thread.js b/src/data/Thread.js index 054b48d..f4357eb 100644 --- a/src/data/Thread.js +++ b/src/data/Thread.js @@ -4,7 +4,7 @@ const Eris = require('eris'); const bot = require('../bot'); const knex = require('../knex'); const utils = require('../utils'); -const config = require('../config'); +const config = require('../cfg'); const attachments = require('./attachments'); const { formatters } = require('../formatters'); diff --git a/src/data/attachments.js b/src/data/attachments.js index 40b13b0..cf8cc6d 100644 --- a/src/data/attachments.js +++ b/src/data/attachments.js @@ -3,7 +3,7 @@ const fs = require('fs'); const https = require('https'); const {promisify} = require('util'); const tmp = require('tmp'); -const config = require('../config'); +const config = require('../cfg'); const utils = require('../utils'); const mv = promisify(require('mv')); diff --git a/src/data/threads.js b/src/data/threads.js index 2fefa7a..6288cb1 100644 --- a/src/data/threads.js +++ b/src/data/threads.js @@ -7,7 +7,7 @@ const humanizeDuration = require('humanize-duration'); const bot = require('../bot'); const knex = require('../knex'); -const config = require('../config'); +const config = require('../cfg'); const utils = require('../utils'); const updates = require('./updates'); diff --git a/src/data/updates.js b/src/data/updates.js index a57bc62..b0e7285 100644 --- a/src/data/updates.js +++ b/src/data/updates.js @@ -2,7 +2,7 @@ const url = require('url'); const https = require('https'); const moment = require('moment'); const knex = require('../knex'); -const config = require('../config'); +const config = require('../cfg'); const UPDATE_CHECK_FREQUENCY = 12; // In hours let updateCheckPromise = null; diff --git a/src/formatters.js b/src/formatters.js index 4230e57..04ed053 100644 --- a/src/formatters.js +++ b/src/formatters.js @@ -1,6 +1,6 @@ const Eris = require('eris'); const utils = require('./utils'); -const config = require('./config'); +const config = require('./cfg'); /** * Function to format the DM that is sent to the user when a staff member replies to them via !reply diff --git a/src/index.js b/src/index.js index 1e23ae3..7c5152e 100644 --- a/src/index.js +++ b/src/index.js @@ -41,7 +41,7 @@ try { process.exit(1); } -const config = require('./config'); +const config = require('./cfg'); const utils = require('./utils'); const main = require('./main'); const knex = require('./knex'); diff --git a/src/knex.js b/src/knex.js index b6b6346..ce33d98 100644 --- a/src/knex.js +++ b/src/knex.js @@ -1,2 +1,2 @@ -const config = require('./config'); +const config = require('./cfg'); module.exports = require('knex')(config.knex); diff --git a/src/legacy/jsonDb.js b/src/legacy/jsonDb.js index d2e8ca1..9b97c05 100644 --- a/src/legacy/jsonDb.js +++ b/src/legacy/jsonDb.js @@ -1,6 +1,6 @@ const fs = require('fs'); const path = require('path'); -const config = require('../config'); +const config = require('../cfg'); const dbDir = config.dbDir; diff --git a/src/legacy/legacyMigrator.js b/src/legacy/legacyMigrator.js index 2c491e3..bf3f947 100644 --- a/src/legacy/legacyMigrator.js +++ b/src/legacy/legacyMigrator.js @@ -5,7 +5,7 @@ const moment = require('moment'); const Eris = require('eris'); const knex = require('../knex'); -const config = require('../config'); +const config = require('../cfg'); const jsonDb = require('./jsonDb'); const threads = require('../data/threads'); diff --git a/src/main.js b/src/main.js index 381efd8..b9a319c 100644 --- a/src/main.js +++ b/src/main.js @@ -1,7 +1,7 @@ const Eris = require('eris'); const path = require('path'); -const config = require('./config'); +const config = require('./cfg'); const bot = require('./bot'); const knex = require('./knex'); const {messageQueue} = require('./queue'); diff --git a/src/modules/close.js b/src/modules/close.js index 774348e..b3173ac 100644 --- a/src/modules/close.js +++ b/src/modules/close.js @@ -1,6 +1,6 @@ const moment = require('moment'); const Eris = require('eris'); -const config = require('../config'); +const config = require('../cfg'); const utils = require('../utils'); const threads = require('../data/threads'); const blocked = require('../data/blocked'); diff --git a/src/modules/greeting.js b/src/modules/greeting.js index f85bde9..1d1d7cb 100644 --- a/src/modules/greeting.js +++ b/src/modules/greeting.js @@ -1,6 +1,6 @@ const path = require('path'); const fs = require('fs'); -const config = require('../config'); +const config = require('../cfg'); const utils = require('../utils'); module.exports = ({ bot }) => { diff --git a/src/modules/move.js b/src/modules/move.js index 973143d..44eefd3 100644 --- a/src/modules/move.js +++ b/src/modules/move.js @@ -1,4 +1,4 @@ -const config = require('../config'); +const config = require('../cfg'); const Eris = require('eris'); const transliterate = require("transliteration"); const erisEndpoints = require('eris/lib/rest/Endpoints'); diff --git a/src/modules/snippets.js b/src/modules/snippets.js index e9c1271..2948849 100644 --- a/src/modules/snippets.js +++ b/src/modules/snippets.js @@ -1,6 +1,6 @@ const threads = require('../data/threads'); const snippets = require('../data/snippets'); -const config = require('../config'); +const config = require('../cfg'); const utils = require('../utils'); const { parseArguments } = require('knub-command-manager'); diff --git a/src/modules/suspend.js b/src/modules/suspend.js index b44b323..61d3708 100644 --- a/src/modules/suspend.js +++ b/src/modules/suspend.js @@ -1,7 +1,7 @@ const moment = require('moment'); const threads = require("../data/threads"); const utils = require('../utils'); -const config = require('../config'); +const config = require('../cfg'); const {THREAD_STATUS} = require('../data/constants'); diff --git a/src/modules/typingProxy.js b/src/modules/typingProxy.js index 5881808..d2e585e 100644 --- a/src/modules/typingProxy.js +++ b/src/modules/typingProxy.js @@ -1,4 +1,4 @@ -const config = require('../config'); +const config = require('../cfg'); const threads = require("../data/threads"); const Eris = require("eris"); diff --git a/src/modules/version.js b/src/modules/version.js index 033fbf0..0411cf0 100644 --- a/src/modules/version.js +++ b/src/modules/version.js @@ -3,7 +3,7 @@ const fs = require('fs'); const {promisify} = require('util'); const utils = require("../utils"); const updates = require('../data/updates'); -const config = require('../config'); +const config = require('../cfg'); const access = promisify(fs.access); const readFile = promisify(fs.readFile); diff --git a/src/modules/webserver.js b/src/modules/webserver.js index 6c8a536..22dff34 100644 --- a/src/modules/webserver.js +++ b/src/modules/webserver.js @@ -4,7 +4,7 @@ const url = require('url'); const fs = require('fs'); const qs = require('querystring'); const moment = require('moment'); -const config = require('../config'); +const config = require('../cfg'); const threads = require('../data/threads'); const attachments = require('../data/attachments'); diff --git a/src/utils.js b/src/utils.js index acb1439..4c5d08d 100644 --- a/src/utils.js +++ b/src/utils.js @@ -3,7 +3,7 @@ const bot = require('./bot'); const moment = require('moment'); const humanizeDuration = require('humanize-duration'); const publicIp = require('public-ip'); -const config = require('./config'); +const config = require('./cfg'); class BotError extends Error {}