From 7a42547372f1a47034bffa7f2cb5cc70464379d2 Mon Sep 17 00:00:00 2001 From: Manohar Reddy Date: Mon, 26 Jun 2023 20:15:57 +0200 Subject: [PATCH] error out if there are any files in the working directory --- cmd/migrate.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/migrate.go b/cmd/migrate.go index 85b25ed..def10fc 100644 --- a/cmd/migrate.go +++ b/cmd/migrate.go @@ -5,7 +5,6 @@ import ( "fmt" "io" "os" - "path" "path/filepath" "regexp" "strconv" @@ -163,8 +162,8 @@ var migrateCmd = &cobra.Command{ return err } } else { - for _, d := range dir { - os.RemoveAll(path.Join([]string{workDir, d.Name()}...)) + if len(dir) > 0 { + return fmt.Errorf("working directory not empty") } }