-
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add
terraform clean --everything
and terraform clean --force
to d…
…elete `terraform.tfstate.d` folder (#727) * add terraform clean delete terraform.tfstate.d folder if the `--everything` flag is provided. * add comment * Refactor processArgsAndFlags function to handle additional options with "--" * Refactor path_utils.go and add new functions for finding folders with a prefix and deleting files and folders recursively * add --everything provide additional options for the 'atmos terraform clean' command * Refactor path_utils.go to improve folder search and deletion functionality * add comment to function * Refactor processArgsAndFlags function to handle options and components separately * Refactor help.go to improve 'atmos terraform clean' command documentation * use filepath ensure cross-platform compatibility * findFoldersNamesWithPrefix function to clarify search levels * Refactor ExecuteTerraform function to use descriptive variable names for files to clear * Refactor ExecuteTerraform function to use descriptive variable names for files and clarify boolean flags * Refactor processArgsAndFlags function to handle additional arguments and flags correctly * Refactor help.go to clarify Terraform state file deletion and add force option * Refactor deleteFilesAndFoldersRecursive function to improve error handling and logging * rename file bubble_msg.go * use log package for deletion logging * Refactor deleteFilesAndFoldersRecursive function to improve error handling and logging * Refactor bubble_msg.go to improve confirmation dialog state handling * Refactor Confirm function to handle confirmation dialog state and model type * Refactor bubble_msg.go to improve confirmation dialog state handling and add navigation instructions * command with --everything or --force flags * remove comment * Refactor error handling in ExecuteTerraform function * Refactor error handling in findFoldersNamesWithPrefix function * Refactor help.go to improve 'atmos terraform clean' command documentation * Refactor error handling in findFoldersNamesWithPrefix and ExecuteTerraform functions * Refactor confirm delete msg * log waring with no confirm msg * Refactor error handling in findFoldersNamesWithPrefix function * Refactor clean command to improve Terraform state file deletion * Refactor clean command to improve Terraform state file deletion * confirm msg color * add log clean all components * check file exist before delete * use filepath pkg * modify log * use DeletePathTerraform utility * Refactor clean subcommand to handle terraform component cleanup * Refactor clean subcommand to use filepath package for path manipulation * Refactor clean empty dir * remove print line for debug * Refactor clean subcommand to handle relative path correctly * Refactor clean subcommand to handle relative path correctly * Refactor help message for 'atmos terraform clean' command * Refactor clean subcommand * Refactor clean subcommand to use u.PrintMessage instead of u.LogInfo for displaying messages * Refactor clean TF_DATA_DIR with everything * Refactor handleTFDataDir to handle relative path correctly * Refactor error messages for invalid TF_DATA_DIR and missing stack * Update internal/exec/terraform_clean.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Refactor handleCleanSubCommand to improve deletion messaging and streamline TF_DATA_DIR handling * Calculate total objects to delete by counting files in folders * Update dependencies in go.mod and go.sum to include new packages * update dependencies: upgrade lipgloss to v1.0.0 and x/ansi to v0.4.2; * chore: update charmbracelet/x dependencies in go.mod * fix: remove duplicate help message for clean operation in help.go * feat: enhance terraform clean command with --everything and --force options; improve argument validation * Update website/docs/cli/commands/terraform/terraform-clean.mdx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update website/docs/cli/commands/terraform/terraform-clean.mdx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update website/docs/cli/commands/terraform/usage.mdx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update website/docs/cli/commands/terraform/usage.mdx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update website/docs/cli/commands/terraform/usage.mdx * Update website/docs/cli/commands/terraform/usage.mdx * Refactor error handling in handleCleanSubCommand for TF_DATA_DIR validation * fix: correct typo in documentation * fix html doc * fix: validate that the base path exists in CollectDirectoryObjects * fix: pass cliConfig to findFoldersNamesWithPrefix and getStackTerraformStateFolder functions * fix: enhance DeletePathTerraform to handle symbolic links and improve error messages * fix: improve error handling in deleteFolders function for better deletion feedback * fix: streamline error handling in deleteFolders function for improved feedback --------- Co-authored-by: Andriy Knysh <[email protected]> Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
39389a2
commit 382de94
Showing
11 changed files
with
607 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.