6
0
mirror of https://github.com/grdl/git-get.git synced 2026-02-04 22:39:41 +00:00

Replace the godirwalk package with a native implementation, replace pathpkg with filepath for better cross-platform support

This commit is contained in:
Grzegorz Dlugoszewski
2025-08-24 12:39:27 +02:00
parent ec99227420
commit 8a9002e678
4 changed files with 43 additions and 60 deletions

View File

@@ -6,7 +6,7 @@ import (
"fmt"
"os"
"os/exec"
pathpkg "path"
"path/filepath"
"strings"
)
@@ -45,7 +45,7 @@ func (c *Cmd) OnRepo(path string) *Cmd {
return c
}
insert := []string{"--work-tree", path, "--git-dir", pathpkg.Join(path, ".git")}
insert := []string{"--work-tree", path, "--git-dir", filepath.Join(path, ".git")}
// Insert into the args slice after the 1st element (https://github.com/golang/go/wiki/SliceTricks#insert)
c.cmd.Args = append(c.cmd.Args[:1], append(insert, c.cmd.Args[1:]...)...)