From b1775c4408bb00803eba321aa66ab92d6ba45580 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sat, 17 Aug 2024 18:29:33 -0400 Subject: kennel (#13) Reviewed-on: https://git.hatecomputers.club/hatecomputers/hatecomputers.club/pulls/13 Co-authored-by: Elizabeth Hunt Co-committed-by: Elizabeth Hunt --- adapters/files/filesystem/filesystem.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'adapters/files/filesystem') diff --git a/adapters/files/filesystem/filesystem.go b/adapters/files/filesystem/filesystem.go index 726a588..e7e671f 100644 --- a/adapters/files/filesystem/filesystem.go +++ b/adapters/files/filesystem/filesystem.go @@ -35,3 +35,8 @@ func (f *FilesystemAdapter) CreateFile(path string, content io.Reader) (string, func (f *FilesystemAdapter) DeleteFile(path string) error { return os.Remove(f.BasePath + path) } + +func (f *FilesystemAdapter) FileExists(path string) bool { + _, err := os.Stat(f.BasePath + path) + return err == nil +} -- cgit v1.2.3-70-g09d2