|
@@ -26,15 +26,12 @@ func main() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
fileInfo, err := os.Stat(arg[0])
|
|
fileInfo, err := os.Stat(arg[0])
|
|
|
- if err != nil {
|
|
|
|
|
- fmt.Println("error parsing argument:", err)
|
|
|
|
|
- os.Exit(1)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if fileInfo.IsDir() {
|
|
|
|
|
- if !issues.IsIssueCollection(fileInfo.Name()) {
|
|
|
|
|
- fmt.Printf("%s is a directory...\n", arg[0])
|
|
|
|
|
- os.Exit(1)
|
|
|
|
|
|
|
+ if err == nil { // file exists
|
|
|
|
|
+ if fileInfo.IsDir() { // file is dir
|
|
|
|
|
+ if !issues.IsIssueCollection(arg[0]) && !issues.IsIssue(arg[0]) { // file is not issue collection and not issue
|
|
|
|
|
+ fmt.Printf("%s is a directory...\n", arg[0])
|
|
|
|
|
+ os.Exit(1)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -44,7 +41,7 @@ func main() {
|
|
|
// tea.WithMouseCellMotion(), // turn on mouse support so we can track the mouse wheel
|
|
// tea.WithMouseCellMotion(), // turn on mouse support so we can track the mouse wheel
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- if _, err := p.Run(); err != nil {
|
|
|
|
|
|
|
+ if _, e := p.Run(); e != nil {
|
|
|
fmt.Println("could not run program:", err)
|
|
fmt.Println("could not run program:", err)
|
|
|
os.Exit(1)
|
|
os.Exit(1)
|
|
|
}
|
|
}
|