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