Basti1110 commited on
Commit
6732924
·
verified ·
1 Parent(s): b06e1d6

Update app.js

Browse files
Files changed (1) hide show
  1. app.js +6 -1
app.js CHANGED
@@ -80,7 +80,12 @@ Analyze the following content in ${language}:
80
  const jsonString = raw.slice(jsonStart, jsonEnd + 1);
81
  const osintData = JSON.parse(jsonString);
82
 
83
- fs.writeFileSync('/mnt/data/data.json', JSON.stringify(osintData));
 
 
 
 
 
84
 
85
 
86
  exec('python3 render_report.py', (error, stdout, stderr) => {
 
80
  const jsonString = raw.slice(jsonStart, jsonEnd + 1);
81
  const osintData = JSON.parse(jsonString);
82
 
83
+ const dir = '/mnt/data';
84
+ if (!fs.existsSync(dir)) {
85
+ fs.mkdirSync(dir, { recursive: true });
86
+ }
87
+ fs.writeFileSync(path.join(dir, 'data.json'), JSON.stringify(osintData));
88
+
89
 
90
 
91
  exec('python3 render_report.py', (error, stdout, stderr) => {