Skip to content

Commit

Permalink
Update source-swap.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
KermitTheHuman authored Dec 31, 2024
1 parent eb4949a commit cd25c86
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions source-swap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@
path_to_main=""
source_swap_found=false

# Check if current working directory contains "prd"
current_dir=$(pwd)
if [[ "$current_dir" == *"/prd"* ]]; then
printf "Warning: Current working directory contains 'prd'. Source swapping should only be done in non-prod environments to avoid unintended changes in production.\n"
printf "Remove the source-swap block from terragrunt.hcl and try again.\n"
fi

while IFS= read -r line || [ -n "$line" ]; do
old_source=""
new_source=""
Expand Down Expand Up @@ -127,4 +120,4 @@ if [[ "$source_swap_found" = false ]]; then
printf "Source-swap was not found in terragrunt.hcl\n"
printf "You can add source-swap code block as follows: (Commented out on purpose to avoid Terragrunt errors - this is not a funtion of Terragrunt)\n"
printf '# source-swap "module_name(Use * to swap all)" {\n# old-source = "old-source-path"\n# new-source = "new-source-path"\n# }\n'
fi
fi

0 comments on commit cd25c86

Please sign in to comment.