refactor(linkedin-studio): M0-5 — queue-manager.mjs via getDataRoot('drafts')

This commit is contained in:
Kjell Tore Guttormsen 2026-06-18 11:31:56 +02:00
commit 7f386943c6
2 changed files with 59 additions and 4 deletions

View file

@ -5,11 +5,9 @@
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'node:fs';
import { join, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { getDataRoot } from './data-root.mjs';
const __dirname = dirname(fileURLToPath(import.meta.url));
const PLUGIN_ROOT = process.env.PLUGIN_ROOT || join(__dirname, '..', '..');
const QUEUE_FILE = join(PLUGIN_ROOT, 'assets', 'drafts', 'queue.json');
const QUEUE_FILE = join(getDataRoot('drafts'), 'queue.json');
function ensureQueue() {
if (!existsSync(QUEUE_FILE)) {