fix: don't var when no var

This commit is contained in:
KernelDeimos 2024-08-28 21:42:41 -04:00
parent d43fc62d89
commit 5f7d1f589a

View File

@ -462,6 +462,11 @@ class LogService extends BaseService {
{
const fs = require('fs');
const path = '/var/puter/logs/heyputer';
// Making this directory if it doesn't exist causes issues
// for users running with development instructions
if ( ! fs.existsSync('/var/puter') ) {
return;
}
try {
fs.mkdirSync(path, { recursive: true });
this.log_directory = path;