coryd.dev/cli/lib/tasks/index.js
Cory Dransfeldt efe701f939
feat(*.liquid): apply prettier to liquid templates
- offer to create tag when none is found while adding a link from cli
- fix tag display in search
2025-06-16 14:41:29 -07:00

27 lines
916 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import inquirer from "inquirer";
import { addPost } from "./addPost.js";
import { addLinkToShare } from "./addLinkToShare.js";
import { addEpisodeToShow } from "./addEpisodeToShow.js";
import { updateReadingProgress } from "./updateReadingProgress.js";
import { addBlockedRobot } from "./addBlockedRobot.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 },
{ name: "🤖 Block robot", handler: addBlockedRobot }
];
export const runTasksMenu = async () => {
const { task } = await inquirer.prompt([
{
type: "list",
name: "task",
message: "Select a task to perform:",
choices: TASKS.map((t) => ({ name: t.name, value: t.handler }))
}
]);
await task();
};