diff --git a/src/features/config.ts b/src/features/config.ts index bccd442..08eb649 100644 --- a/src/features/config.ts +++ b/src/features/config.ts @@ -10,13 +10,14 @@ export async function handleConfig(options: { quiet?: boolean; verbose?: boolean if (options.verbose) { command += ' --verbose'; } + const result = await runCommand(command); if (!options.quiet) { consola.info(`🔧 Homebrew Configuration:\n${result}`); } - } catch (error) { + } catch (error: any) { if (!options.quiet) { - consola.error(`Error retrieving Homebrew configuration: ${error}`); + consola.error(`❌ Error retrieving Homebrew configuration: ${error.message}`); } } } \ No newline at end of file diff --git a/src/features/create.ts b/src/features/create.ts index 763c1e0..3c4eb23 100644 --- a/src/features/create.ts +++ b/src/features/create.ts @@ -59,17 +59,17 @@ export const handleCreate = async (url: string, options: { // Handle output based on the options if (!options.quiet) { if (stdout) { - consola.log(stdout); + consola.log(`📦 ${stdout}`); } if (stderr) { - consola.error(stderr); + consola.error(`⚠️ ${stderr}`); } } } catch (error: any) { // Handle errors - consola.error(`Error executing brew create: ${error.message}`); + consola.error(`❌ Error executing brew create: ${error.message}`); if (error.stderr) { - consola.error(error.stderr); + consola.error(`⚠️ ${error.stderr}`); } process.exit(1); // Exit with a non-zero status } diff --git a/src/features/doctor.ts b/src/features/doctor.ts index 969da08..8d2d8e9 100644 --- a/src/features/doctor.ts +++ b/src/features/doctor.ts @@ -41,17 +41,17 @@ export const handleDoctor = async (options: { // Handle output based on the options if (!options.quiet) { if (stdout) { - consola.log(stdout); + consola.log(`🩺 ${stdout}`); // Using a stethoscope emoji to indicate health check } if (stderr) { - consola.error(stderr); + consola.error(`⚠️ ${stderr}`); // Warning emoji for errors } } } catch (error: any) { // Handle errors - consola.error(`Error executing brew doctor: ${error.message}`); + consola.error(`❌ Error executing brew doctor: ${error.message}`); if (error.stderr) { - consola.error(error.stderr); + consola.error(`⚠️ ${error.stderr}`); } process.exit(1); // Exit with a non-zero status } diff --git a/src/features/edit.ts b/src/features/edit.ts index 410f98b..2dbbe62 100644 --- a/src/features/edit.ts +++ b/src/features/edit.ts @@ -37,17 +37,17 @@ export const handleEdit = async (args: string[], options: { // Handle output based on the options if (!options.quiet) { if (stdout) { - consola.log(stdout); + consola.log(`✏️ ${stdout}`); // Using a pencil emoji to indicate editing } if (stderr) { - consola.error(stderr); + consola.error(`⚠️ ${stderr}`); // Warning emoji for errors } } } catch (error: any) { // Handle errors - consola.error(`Error executing brew edit: ${error.message}`); + consola.error(`❌ Error executing brew edit: ${error.message}`); if (error.stderr) { - consola.error(error.stderr); + consola.error(`⚠️ ${error.stderr}`); } process.exit(1); // Exit with a non-zero status } diff --git a/src/features/version.ts b/src/features/version.ts new file mode 100644 index 0000000..be3f530 --- /dev/null +++ b/src/features/version.ts @@ -0,0 +1,7 @@ +import consola from 'consola'; // Ensure this import is correct +import { runCommand } from '../command'; + + +export function handleVersion() { + consola.box("Brewy Version 1.0.0") +} \ No newline at end of file