-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
feat(CLI): update CLI logo and delete function
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,4 +127,6 @@ out | |
.yarn/unplugged | ||
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* | ||
.pnp.* | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import loadSnippets from '../core/get-snippets'; | ||
|
||
export default async function listAll() { | ||
const snippets = loadSnippets(); | ||
const detailedSnippetsPromises = snippets.map(async (snippet: Snippet) => { | ||
return { | ||
ID: snippet.id, | ||
title: snippet.title, | ||
language: snippet.language, | ||
}; | ||
}); | ||
const detailedSnippets = await Promise.all(detailedSnippetsPromises); | ||
console.table(detailedSnippets); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import chalk from 'chalk'; | ||
import figlet from 'figlet'; | ||
|
||
export default function generateLogo() { | ||
// Generate figlet text for both symbols | ||
const arrow = figlet.textSync('>', { font: '3D-ASCII' }); | ||
const text = figlet.textSync('CSM', { font: '3D-ASCII' }); | ||
|
||
// Split the generated text into lines | ||
const arrowLines = arrow.split('\n'); | ||
const textLines = text.split('\n'); | ||
|
||
// To ensure both pieces have the same number of lines | ||
const maxLength = Math.max(arrowLines.length, textLines.length); | ||
|
||
// Create a combined text with colored lines | ||
const combinedLines = []; | ||
for (let i = 0; i < maxLength; i++) { | ||
const arrowLine = arrowLines[i] || ''; | ||
const textLine = textLines[i] || ''; | ||
|
||
combinedLines.push(chalk.green(arrowLine) + chalk.red(textLine)); | ||
} | ||
|
||
// Print each combined line | ||
combinedLines.forEach((line) => console.log(line)); | ||
} |