1 Commits

Author SHA1 Message Date
15f7db8d3e ignore files 2025-04-02 16:23:15 +02:00
2 changed files with 3 additions and 14 deletions

2
.gitignore vendored
View File

@ -1,2 +0,0 @@
**/__debug_bin*
main

View File

@ -3,10 +3,8 @@ package main
import (
"flag"
"fmt"
"os"
"git.schreifuchs.ch/schreifuchs/pat/pkg/cat"
"git.schreifuchs.ch/schreifuchs/pat/pkg/clip"
"git.schreifuchs.ch/schreifuchs/pat/pkg/ignore"
)
@ -20,15 +18,13 @@ func main() {
cats, err := cat.Path(flag.Args()...)
if err != nil {
fmt.Println(err.Error())
os.Exit(1)
panic(err)
}
if *ignorePath != "" {
i, err := ignore.FindGitignore(*ignorePath)
if err != nil {
fmt.Printf("can't get gitignore: %v", err)
os.Exit(1)
panic(err)
}
cats = cats.Ignored(i)
@ -37,11 +33,6 @@ func main() {
cats = cats.Ignored(ignore.Filesystem{})
}
out := cats.ToString(DELEMITTER)
fmt.Print(out)
fmt.Print(cats.ToString(DELEMITTER))
if err = clip.Copy(out); err != nil {
fmt.Println(err.Error())
os.Exit(1)
}
}