Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
koudaiii committed Oct 13, 2021
1 parent 77f1d6b commit 979aa08
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/meta/meta_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ func newMetaImpl(rg string, outputDir string) (Meta, error) {
return nil, fmt.Errorf("creating workspace root %q: %w", rootDir, err)
}

tfDir := filepath.Join(rootDir, "aztfy"), "terraform")
if err := os.MkdirAll(tfDir, 0755); err != nil {
return nil, fmt.Errorf("creating terraform cache dir %q: %w", tfDir, err)
}

if outputDir != "" {
currentWorkingDirectory, err := os.Getwd()
if err != nil {
Expand All @@ -56,11 +61,6 @@ func newMetaImpl(rg string, outputDir string) (Meta, error) {
rootDir = filepath.Join(currentWorkingDirectory, outputDir)
}

tfDir := filepath.Join(filepath.Join(cachedir, "aztfy"), "terraform")
if err := os.MkdirAll(tfDir, 0755); err != nil {
return nil, fmt.Errorf("creating terraform cache dir %q: %w", tfDir, err)
}

wsp := filepath.Join(rootDir, rg)
if err := os.RemoveAll(wsp); err != nil {
return nil, fmt.Errorf("removing existing workspace %q: %w", wsp, err)
Expand Down

0 comments on commit 979aa08

Please sign in to comment.