Skip to content

Commit

Permalink
better cloud up repo cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljguarino committed Dec 23, 2024
1 parent 1fdd5cd commit b1cbd47
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pkg/up/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

func (ctx *Context) Prune() error {
if ctx.Cloud {
return nil
return ctx.pruneCloud()
}

utils.Highlight("\nCleaning up unneeded resources...\n\n")
Expand Down Expand Up @@ -42,6 +42,18 @@ func (ctx *Context) Prune() error {
return git.Sync(repoRoot, "Post-setup resource cleanup", true)
}

func (ctx *Context) pruneCloud() error {
utils.Highlight("\nCleaning up unneeded resources...\n\n")
repoRoot, err := git.Root()
if err != nil {
return err
}

_ = os.RemoveAll("./terraform/apps")

return git.Sync(repoRoot, "Post-setup resource cleanup", true)
}

func stateRm(dir, field string) error {
cmd := exec.Command("terraform", "state", "rm", field)
cmd.Dir = dir
Expand Down

0 comments on commit b1cbd47

Please sign in to comment.