From 969315dacc0d509bef0686a29fe91e5de6588671 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 3 Apr 2018 20:14:57 -0400 Subject: [PATCH] Updated fs, only read files. --- package.json | 1 - src/data.js | 6 +----- yarn.lock | 20 +------------------- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index 892322c..a7b8ec8 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,6 @@ "dependencies": { "checkenv": "^1.2.2", "discord.js": "^11.3.0", - "fs-extra": "^5.0.0", "ip": "^1.1.5", "logdna": "^1.2.3", "node-schedule": "^1.2.3", diff --git a/src/data.js b/src/data.js index 9281a32..1f72654 100644 --- a/src/data.js +++ b/src/data.js @@ -1,11 +1,10 @@ -const fs = require('fs-extra'); +const fs = require('fs'); const state = require('./state.js'); const logger = require('./logging.js'); function readWarnings() { // Load the warnings file into the application state. var readFilePath = '/data/discordWarnings.json'; - fs.ensureFileSync(readFilePath); fs.readFile(readFilePath, 'utf8', function (err, data) { if (err) { throw err; } if (data) { @@ -20,7 +19,6 @@ function readWarnings() { function readBans() { // Load the ban file into the application state. var readFilePath = '/data/discordBans.json'; - fs.ensureFileSync(readFilePath); fs.readFile(readFilePath, 'utf8', function (err, data) { if (err) { throw err; } if (data) { @@ -35,8 +33,6 @@ function readBans() { function readCustomResponses() { // Load the responses file into the responses variable. var readFilePath = '/data/responses.json'; - fs.ensureFileSync(readFilePath); - fs.readFile(readFilePath, 'utf8', function (err, data) { if (err) { throw err; } if (data) { diff --git a/yarn.lock b/yarn.lock index a5ef3a1..5d0c354 100644 --- a/yarn.lock +++ b/yarn.lock @@ -602,14 +602,6 @@ form-data@~2.3.1: combined-stream "1.0.6" mime-types "^2.1.12" -fs-extra@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-5.0.0.tgz#414d0110cdd06705734d055652c5411260c31abd" - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -654,7 +646,7 @@ globby@^5.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" -graceful-fs@^4.1.2, graceful-fs@^4.1.6: +graceful-fs@^4.1.2: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" @@ -857,12 +849,6 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - optionalDependencies: - graceful-fs "^4.1.6" - jsprim@^1.2.2: version "1.4.1" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" @@ -1480,10 +1466,6 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -universalify@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7" - util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"