From e08b9fc45698641cc7885622dd7bbdf9436850dd Mon Sep 17 00:00:00 2001 From: Androz2091 Date: Wed, 12 Aug 2020 14:09:39 +0200 Subject: [PATCH] :bug: Check if path exists before updating docs --- helpers/autoUpdateDocs.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/helpers/autoUpdateDocs.js b/helpers/autoUpdateDocs.js index 18fcfe9018..35b017afd6 100644 --- a/helpers/autoUpdateDocs.js +++ b/helpers/autoUpdateDocs.js @@ -48,8 +48,10 @@ module.exports = { text += `${table(arrCat)}\n\n`; }); const fs = require("fs"); - fs.writeFileSync("./docs/commands.md", text); - client.logger.log("Docs updated!"); + if(fs.existsSync("./docs")){ + fs.writeFileSync("./docs/commands.md", text); + client.logger.log("Docs updated!"); + } } }; \ No newline at end of file