- offer to create tag when none is found while adding a link from cli - fix tag display in search
27 lines
916 B
JavaScript
27 lines
916 B
JavaScript
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();
|
||
};
|