Skip to content

Commit

Permalink
Merge pull request #30 from nico-i/feat/cat-base64
Browse files Browse the repository at this point in the history
feat: cat images now returns nggyu base64
  • Loading branch information
nico-i authored Jan 1, 2024
2 parents c71453a + 16b861f commit 9443c25
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/Cli/cmd/cat/cat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {
UsageTuple,
} from '@/components/Cli/cmd/types/CliCmd';
import { allFileNames, allFilesByName } from '@/components/Cli/files';
import { allImageNames } from '@/components/Cli/files/images';
import { nggyuImages } from '@/components/Cli/files/images/nggyu';
import { ReactNode } from 'react';

export class Cat extends CliCmd {
Expand All @@ -25,6 +27,10 @@ export class Cat extends CliCmd {
if (!allFileNames.includes(values[0])) {
throw new ValueError(`file`, values[0]);
}
if (allImageNames.includes(values[0])) {
return nggyuImages[Math.floor(Math.random() * nggyuImages.length)];
}

return allFilesByName[values[0]].run();
}
}
Loading

0 comments on commit 9443c25

Please sign in to comment.