From 1cf120ed94389e684c785401823f6082ca5b224f Mon Sep 17 00:00:00 2001 From: Skyascii Date: Wed, 9 Feb 2022 12:11:19 +0400 Subject: [PATCH] fix: crlf not being split --- .prettierrc | 3 +++ commands/neofetch.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..544138b --- /dev/null +++ b/.prettierrc @@ -0,0 +1,3 @@ +{ + "singleQuote": true +} diff --git a/commands/neofetch.js b/commands/neofetch.js index 6d9e337..b6b97ea 100644 --- a/commands/neofetch.js +++ b/commands/neofetch.js @@ -102,7 +102,7 @@ export async function execute(interaction) { // Read file.txt and split on new lines const fileContents = fs .readFileSync(path.resolve(__dirname, `../assets/${distro}.txt`), 'utf8') - .split('\n'); + .split(/[\r\n]+/); // Additional whitespace for the ascii arts // 'discord' is exempted as the ascii art is already too big