MCPcopy Index your code
hub / github.com/MigoXLab/coderio / registerImagesCommand

Function registerImagesCommand

src/cli/images.ts:8–28  ·  view source on GitHub ↗
(program: Command)

Source from the content-addressed store, hash-verified

6
7// images command: detect images from Figma document and download them
8export const registerImagesCommand = (program: Command) => {
9 program
10 .command('get-images')
11 .alias('images')
12 .description('Detect images from Figma document and download them')
13 .option('-s, --source <url>', 'Figma Link')
14 .action(async (opts: { source: string }) => {
15 try {
16 const { source } = opts;
17 const urlInfo = parseFigmaUrl(source);
18 const workspace = workspaceManager.initWorkspace(urlInfo.name);
19 await executeFigmaAndImagesActions(urlInfo, workspace.root, workspace.root);
20
21 logger.printSuccessLog('Successfully completed detection of images from Figma document!');
22 logger.printInfoLog(`Please check the output in the workspace: ${workspace.process}`);
23 } catch (error) {
24 logger.printErrorLog(`Error during images execution: ${error instanceof Error ? error.message : String(error)}`);
25 process.exit(1);
26 }
27 });
28};

Callers 1

mainFunction · 0.90

Calls 3

parseFigmaUrlFunction · 0.90
initWorkspaceMethod · 0.80

Tested by

no test coverage detected