From f24d8131c3f995f9c24a37cb5a8e46da840f2eb0 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 1 Dec 2024 11:44:20 -0600 Subject: [PATCH] add IsDirectory() check --- shell.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/shell.go b/shell.go index 7670329..8724a34 100644 --- a/shell.go +++ b/shell.go @@ -60,3 +60,11 @@ func (repo *Repo) Exists(filename string) bool { } return true } + +func (repo *Repo) IsDirectory() bool { + info, err := os.Stat(repo.FullPath) + if err != nil { + return false + } + return info.IsDir() +}