feat: add ability to pass flags to git commit

This commit is contained in:
Slug-Boi
2024-11-28 10:49:12 +01:00
parent 54d038680f
commit c4671efd9c
4 changed files with 65 additions and 7 deletions
+8 -2
View File
@@ -61,9 +61,15 @@ skip_loop:
return sb.String()
}
func GitWrapper(commit string) {
func GitWrapper(commit string, flags []string) {
// commit shell command
cmd := exec.Command("git", "commit", "-m", commit)
// specify git command
input := []string{"commit"}
// append the message to the flags
flags = append(flags, "-m", commit)
// concat the git command and the flags + message
input = append(input, flags...)
cmd := exec.Command("git", input...)
// https://stackoverflow.com/questions/18159704/how-to-debug-exit-status-1-error-when-running-exec-command-in-golang