From d8344da52416e1161706ef704f0dfb2e5dced15f Mon Sep 17 00:00:00 2001 From: Logan Fick Date: Sat, 6 Jul 2024 12:18:56 -0400 Subject: [PATCH] Reformatted directory cleanup function. --- utils/utils.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/utils/utils.go b/utils/utils.go index c239fd5ca..d900f35bd 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -306,17 +306,17 @@ func VerifyFFMpegPath(path string) error { func CleanupDirectory(path string) { log.Traceln("Cleaning", path) if err := os.MkdirAll(path, 0o750); err != nil { - log.Fatalf("Unable to create '%s'. Please check the ownership and permissions: %s\n", path, err) + log.Fatalf("Unable to create '%s'. Please check the ownership and permissions: %s\n", path, err) } entries, err := os.ReadDir(path) if err != nil { - log.Fatalf("Unable to read contents of '%s'. Please check the ownership and permissions: %s\n", path, err) + log.Fatalf("Unable to read contents of '%s'. Please check the ownership and permissions: %s\n", path, err) } for _, entry := range entries { - entryPath := filepath.Join(path, entry.Name()) - if err := os.RemoveAll(entryPath); err != nil { - log.Fatalf("Unable to remove file or directory contained in '%s'. Please check the ownership and permissions: %s\n", path, err) - } + entryPath := filepath.Join(path, entry.Name()) + if err := os.RemoveAll(entryPath); err != nil { + log.Fatalf("Unable to remove file or directory contained in '%s'. Please check the ownership and permissions: %s\n", path, err) + } } }