mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 06:28:53 +00:00
fix: added util for parsing cookies from json and convert to single-line string to .txt
This commit is contained in:
1 parent
4b7e81b9d4
commit
06a3b68850
2 files changed
+19
No files matched your search
@@ -5,3 +5,5 @@
|
||||
/app-*.log
|
||||
/logs
|
||||
/logs/app-*.log
|
||||
/cookies.json
|
||||
/cookies.txt
|
||||
@@ -0,0 +1,17 @@
|
||||
const path = require('node:path');
|
||||
const fs = require('node:fs');
|
||||
const cookies = require(path.resolve('./cookies.json'));
|
||||
|
||||
try {
|
||||
const cookieString = cookies
|
||||
.map(({ name, value }) => {
|
||||
return `${name}=${value}`;
|
||||
})
|
||||
.join('; ');
|
||||
|
||||
fs.writeFile(path.resolve('./cookies.txt'), cookieString, () => {
|
||||
return process.exit(0);
|
||||
});
|
||||
} catch (error) {
|
||||
process.exit(1);
|
||||
}
|
||||
Reference in new issue
Block a user