feat(cli): add support for repeated directus tasks

This commit is contained in:
Cory Dransfeldt 2025-06-08 17:21:05 -07:00
parent 8a12e83b13
commit 1f9e2d856f
No known key found for this signature in database
11 changed files with 601 additions and 5 deletions

25
cli/lib/tasks/index.js Normal file
View file

@ -0,0 +1,25 @@
import inquirer from 'inquirer';
import { addPost } from './addPost.js';
import { addLinkToShare } from './addLinkToShare.js';
import { addEpisodeToShow } from './addEpisodeToShow.js';
import { updateReadingProgress } from './updateReadingProgress.js';
const TASKS = [
{ name: '📄 Add post', handler: addPost },
{ name: '🔗 Add link to share', handler: addLinkToShare },
{ name: ' Add episode to show', handler: addEpisodeToShow },
{ name: '📚 Update reading progress', handler: updateReadingProgress },
];
export const runTasksMenu = async () => {
const { task } = await inquirer.prompt([
{
type: 'list',
name: 'task',
message: 'Select a task to run:',
choices: TASKS.map(t => ({ name: t.name, value: t.handler }))
}
]);
await task();
};