Skip to content

Commit

Permalink
metha-ls: an empty dir is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
miku committed Sep 28, 2024
1 parent a276f75 commit 2ee4626
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/metha-ls/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"flag"
"fmt"
"io/ioutil"
"os"
"strings"

"github.com/miku/metha"
Expand All @@ -25,6 +26,10 @@ func ellipsis(s string, length int) string {

func main() {
flag.Parse()
basedir := metha.GetBaseDir()
if _, err := os.Stat(basedir); os.IsNotExist(err) {
return
}
files, err := ioutil.ReadDir(metha.GetBaseDir())
if err != nil {
log.Fatal(err)
Expand Down

0 comments on commit 2ee4626

Please sign in to comment.