Skip to content

Commit

Permalink
fix: 🐛run git command to resolve includeIf
Browse files Browse the repository at this point in the history
  • Loading branch information
ShuheiKubota committed Apr 16, 2024
1 parent 21d238a commit 22b6073
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"sort"
"strings"
Expand Down Expand Up @@ -112,7 +113,20 @@ func (c globalCmd) Run() error {
return nil
}

_, err = wt.Commit(msg, &git.CommitOptions{})
f, err := os.CreateTemp("", "")
if err != nil {
return err
}
_, err = f.WriteString(msg)
if err != nil {
f.Close()
return err
}
f.Close()

cmd := exec.Command("git", "commit", "-F", f.Name())
err = cmd.Run()
os.Remove(f.Name())
if err != nil {
return err
}
Expand Down

0 comments on commit 22b6073

Please sign in to comment.