aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2024-10-15 13:42:12 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2024-10-15 13:42:12 +0200
commit84c1da510897f945097d6a06d9df2da38d0abb9d (patch)
tree041e52488eb17dbf725c8182db8fe98bfda3fff7
parentcdeff3519111f923d68cf0b501d80e00782eaa7c (diff)
fix(kdev): Pass by referencev0.5.4
-rw-r--r--README.md4
-rw-r--r--cmd/kdev/main.go6
2 files changed, 3 insertions, 7 deletions
diff --git a/README.md b/README.md
index 9eb235d..c421e7f 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,3 @@
2. Use `Tr("key", value...)` in you templ files
3. Complete generated files
4. Run
-
-## kdev
-
-- Add a config file for excludes
diff --git a/cmd/kdev/main.go b/cmd/kdev/main.go
index f639716..bbf06d7 100644
--- a/cmd/kdev/main.go
+++ b/cmd/kdev/main.go
@@ -72,7 +72,7 @@ func main() {
kcore.Expect(err, "Error getting HEAD")
head, err := repo.CommitObject(ref.Hash())
kcore.Expect(err, "Error getting commit object")
- kcore.Expect(walkRepo(keywords, head, records), "Error walking directory")
+ kcore.Expect(walkRepo(keywords, head, &records), "Error walking directory")
records = lo.Filter(records, func(record Record, index int) bool { return record.date.After(after) })
if *sortBy == "random" {
@@ -86,7 +86,7 @@ func main() {
}
}
-func walkRepo(keywords []string, head *object.Commit, records []Record) error {
+func walkRepo(keywords []string, head *object.Commit, records *[]Record) error {
progress := progressbar.Default(-1, "Scanning")
return filepath.WalkDir(*repoPath, func(path string, d fs.DirEntry, err error) error {
relativePath := strings.TrimPrefix(path, *repoPath)
@@ -106,7 +106,7 @@ func walkRepo(keywords []string, head *object.Commit, records []Record) error {
}
if !d.IsDir() {
kcore.Expect(progress.Add(1), "Error incrementing progress")
- return processFile(*repoPath, relativePath, keywords, &records, head)
+ return processFile(*repoPath, relativePath, keywords, records, head)
}
return nil
})