fix(commands): commit crash upon missing HEAD (#19)

This commit is contained in:
2024-03-08 23:03:11 +02:00
parent 4b0ce0fd3a
commit 7b499d7638

View File

@@ -69,6 +69,7 @@ const command = new Command("commit")
process.exit(0);
}
try {
const changedLines = (
(
await simpleGit().diff(["--numstat", stageAll ? "HEAD" : "--cached"])
@@ -92,6 +93,9 @@ const command = new Command("commit")
process.exit(0);
}
}
} catch {
note("HEAD hasn't been found, skipping commit line amount check");
}
const type: string | symbol = await select({
message: "Choose a commit type",