Skip to content

Commit

Permalink
fix clean cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
haitham911 committed Dec 19, 2024
1 parent fe637fa commit 6832ddd
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions internal/exec/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,10 @@ func ExecuteTerraform(info schema.ConfigAndStacksInfo) error {
shouldCheckStack := true
// Skip stack processing when cleaning with --everything or --force flags to allow
// cleaning without requiring stack configuration
if info.SubCommand == "clean" &&
(u.SliceContainsString(info.AdditionalArgsAndFlags, everythingFlag) ||
u.SliceContainsString(info.AdditionalArgsAndFlags, forceFlag)) {
if info.SubCommand == "clean" {
if info.ComponentFromArg == "" {
shouldProcessStacks = false
}

shouldCheckStack = info.Stack != ""

}
Expand All @@ -96,7 +93,7 @@ func ExecuteTerraform(info schema.ConfigAndStacksInfo) error {
}
}

if !info.ComponentIsEnabled {
if !info.ComponentIsEnabled && info.SubCommand != "clean" {
u.LogInfo(atmosConfig, fmt.Sprintf("component '%s' is not enabled and skipped", info.ComponentFromArg))
return nil
}
Expand Down

0 comments on commit 6832ddd

Please sign in to comment.