Skip to content

Commit

Permalink
Merge pull request #73 from 0chain/fix-wd
Browse files Browse the repository at this point in the history
error out if there are any files in the working directory
  • Loading branch information
Kishan-Dhakan authored Jun 26, 2023
2 parents c7e31ff + 7a42547 commit 35e2207
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"io"
"os"
"path"
"path/filepath"
"regexp"
"strconv"
Expand Down Expand Up @@ -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")
}
}

Expand Down

0 comments on commit 35e2207

Please sign in to comment.