feat(cli): show commit hash and summary on success
This commit is contained in:
@@ -359,8 +359,16 @@ async function main() {
|
||||
|
||||
if (action === "y") {
|
||||
try {
|
||||
await commit(message);
|
||||
console.log(`\n ${GREEN}Committed successfully!${RESET}`);
|
||||
const result = await commit(message);
|
||||
console.log(
|
||||
`\n ${GREEN}${BOLD}✔ Committed successfully!${RESET}`,
|
||||
);
|
||||
if (result.hash) {
|
||||
console.log(` ${YELLOW}${result.hash}${RESET} ${message}`);
|
||||
}
|
||||
if (result.summary) {
|
||||
console.log(` ${DIM}${result.summary}${RESET}`);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(
|
||||
` ${RED}Commit failed: ${err instanceof Error ? err.message : err}${RESET}`,
|
||||
@@ -371,8 +379,16 @@ async function main() {
|
||||
const edited = await editMessage(message);
|
||||
if (edited) {
|
||||
try {
|
||||
await commit(edited);
|
||||
console.log(`\n ${GREEN}Committed successfully!${RESET}`);
|
||||
const result = await commit(edited);
|
||||
console.log(
|
||||
`\n ${GREEN}${BOLD}✔ Committed successfully!${RESET}`,
|
||||
);
|
||||
if (result.hash) {
|
||||
console.log(` ${YELLOW}${result.hash}${RESET} ${edited}`);
|
||||
}
|
||||
if (result.summary) {
|
||||
console.log(` ${DIM}${result.summary}${RESET}`);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(
|
||||
` ${RED}Commit failed: ${err instanceof Error ? err.message : err}${RESET}`,
|
||||
|
||||
Reference in New Issue
Block a user