Skip to content

Commit

Permalink
refactor(core): index + restart + extras
Browse files Browse the repository at this point in the history
  • Loading branch information
RajaRakoto committed Dec 8, 2024
1 parent c0e4300 commit 09aa326
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/core/restart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import inquirer from "inquirer";
import chalk from "chalk";

/* index */
import { lucyCLI } from "@/index";
import { myCLI } from "@/index";

/* utils */
import { exitCLI } from "@/utils/extras";
Expand All @@ -26,7 +26,7 @@ export async function restartAsync(spinner?: Ora): Promise<void> {
if (spinner) spinner.stop();
const restart_answers = await inquirer.prompt(restart_prompt);
if (restart_answers.restart) {
lucyCLI();
myCLI();
} else {
exitCLI();
}
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import pkg from "../package.json";
/**
* @description Entry point of the CLI
*/
export async function lucyCLI(): Promise<void> {
export async function myCLI(): Promise<void> {
// show banner
const banner = await bannerRendererAsync("lucy", `${pkg.description}`);
const banner = await bannerRendererAsync("My-CLI", `${pkg.description}`);
console.log(`${banner}\n`);

// start menu
Expand All @@ -43,7 +43,7 @@ export async function lucyCLI(): Promise<void> {
exitCLI();
break;
default:
lucyCLI();
myCLI();
break;
}
}
Expand All @@ -56,7 +56,7 @@ function args(): void {
if (program.opts().version) {
console.log(`version ${packageVersion}`);
} else {
lucyCLI();
myCLI();
}
}

Expand Down
6 changes: 2 additions & 4 deletions src/utils/extras.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,8 @@ export function successMessage(
file: string,
emojiCode: string,
context: string,
): void {
console.log(
chalk.green(`${emoji.get(emojiCode)} ${file} ${context} ... [done]`),
);
): string {
return chalk.green(`${emoji.get(emojiCode)} ${file} ${context} ... [done]`)
}

/**
Expand Down

0 comments on commit 09aa326

Please sign in to comment.