Skip to content

Commit

Permalink
Check that is empty. If not, we shall error out becasuse of we don't …
Browse files Browse the repository at this point in the history
…accidentally remove anything
  • Loading branch information
koudaiii committed Oct 14, 2021
1 parent cb216e9 commit 3d9e358
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/meta/meta_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ func newMetaImpl(rg string, outputDir string) (Meta, error) {
}

wsp = filepath.Join(currentWorkingDirectory, outputDir)
_, err = os.Stat(wsp)
if !os.IsNotExist(err) {
return nil, fmt.Errorf("already existing workspace %q: %w", wsp, err)
}
}

if err := os.RemoveAll(wsp); err != nil {
Expand Down

0 comments on commit 3d9e358

Please sign in to comment.