"use strict"; import fs from 'fs'; import path from 'path'; import log from '../../lib/io/NamespacedLog.mjs'; const l = log("agent"); import settings from '../../settings.mjs'; import toml_settings_read from '../../lib/io/TomlSettings.mjs'; import SystemQuery from '../../lib/SystemQuery.mjs'; // HACK: Make sure __dirname is defined when using es6 modules. I forget where I found this - a PR with a source URL would be great :D const __dirname = import.meta.url.slice(7, import.meta.url.lastIndexOf("/")); export default async function () { if(!fs.existsSync(settings.cli.config)) throw new Error(`Error: The config file at '${settings.cli.config}' doesn't appear to exist, or we don't have permission to access it.`); console.error(` ███████ ██ ██ ███████ ████████ ███████ ███ ███ ██████ ██ ██ ███████ ██████ ██ ██ ██ ██ ██ ██ ██ ██ ████ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███████ ████ ███████ ██ █████ ██ ████ ██ ██ ██ ██ ██ █████ ██████ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ▄▄ ██ ██ ██ ██ ██ ██ ██ ███████ ██ ███████ ██ ███████ ██ ██ ██████ ██████ ███████ ██ ██ ██ ▀▀`); let config = toml_settings_read( path.join(__dirname, "config.default.toml"), settings.cli.config ); // Returns the systemquery instance, but we don't actually need it here await SystemQuery.Create(config); }