mirror of
https://github.com/godotengine/godot-team-reports.git
synced 2025-12-31 13:48:17 +03:00
Fix logging for CI
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const fs = require('fs').promises;
|
||||
const fsConstants = require('fs').constants;
|
||||
const path = require('path');
|
||||
const fetch = require('node-fetch');
|
||||
|
||||
@@ -51,6 +52,12 @@ async function fetchGithub(query) {
|
||||
|
||||
async function logResponse(data, name) {
|
||||
try {
|
||||
try {
|
||||
await fs.access("logs", fsConstants.R_OK | fsConstants.W_OK);
|
||||
} catch (err) {
|
||||
await fs.mkdir("logs");
|
||||
}
|
||||
|
||||
await fs.writeFile(`logs/${name}.json`, JSON.stringify(data, null, 4), {encoding: "utf-8"});
|
||||
} catch (err) {
|
||||
console.error("Error saving log file: " + err);
|
||||
|
||||
Reference in New Issue
Block a user