SCREENSHOTS_DIR=0 to disable screenshots, fixes #172

This commit is contained in:
Ralf Vogler 2023-07-20 16:10:50 +02:00
parent 22f673282b
commit b5ead8ea21
6 changed files with 24 additions and 20 deletions

View file

@ -7,6 +7,9 @@ const __dirname = path.dirname(__filename);
// explicit object instead of Object.fromEntries since the built-in type would loose the keys, better type: https://dev.to/svehla/typescript-object-fromentries-389c
export const dataDir = s => path.resolve(__dirname, 'data', s);
// modified path.resolve to return null if first argument is '0', used to disable screenshots
export const resolve = (...a) => a.length && a[0] == '0' ? null : path.resolve(...a);
// json database
import { Low } from 'lowdb';
import { JSONFile } from 'lowdb/node';