Skip to content

Commit

Permalink
fix(softfloat/gen): improve gofumpt command to use dynamic root path
Browse files Browse the repository at this point in the history
  • Loading branch information
omarsy committed Jan 23, 2025
1 parent 4edc951 commit 5c8031a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions gnovm/pkg/gnolang/internal/softfloat/gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"log"
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
)
Expand Down Expand Up @@ -82,8 +83,13 @@ func processSoftFloat64TestFile() {
}

func gofumpt() {
cmd := exec.Command("go", "run", "-modfile", "../../../../../misc/devdeps/go.mod", "mvdan.cc/gofumpt", "-w", ".")
_, err := cmd.Output()
rootPath, err := exec.Command("git", "rev-parse", "--show-toplevel").Output()
if err != nil {
log.Fatal("error git rev-parse:", err)
}

cmd := exec.Command("go", "run", "-modfile", filepath.Join(strings.TrimSpace(string(rootPath)), "misc/devdeps/go.mod"), "mvdan.cc/gofumpt", "-w", ".")
_, err = cmd.Output()
if err != nil {
log.Fatal("error gofumpt:", err)
}
Expand Down

0 comments on commit 5c8031a

Please sign in to comment.