<commit_before><% autogen_exception -%>
#!/bin/bash
<% provider_name = version.nil? || version == 'ga' ? 'google' : 'google-' + version -%>
set -e
set -x
if [ -z "$1" ]; then
  echo "Must provide 1 argument - name of resource to diff, e.g. 'google_compute_forwarding_rule'"
  exit 1
fi

function cleanup() {
  go mod edit -dropreplace=github.com/hashicorp/terraform-provider-clean-<%= provider_name %>
  go mod edit -droprequire=github.com/hashicorp/terraform-provider-clean-<%= provider_name %>
}

trap cleanup EXIT
if [[ -d ~/go/src/github.com/hashicorp/terraform-provider-clean-<%= provider_name %> ]]; then
  pushd ~/go/src/github.com/hashicorp/terraform-provider-clean-<%= provider_name %>
  git clean -fdx
  git reset --hard
  git checkout master
  git pull
  popd
else
  mkdir -p ~/go/src/github.com/hashicorp
  git clone https://github.com/hashicorp/terraform-provider-<%= provider_name %> ~/go/src/github.com/hashicorp/terraform-provider-clean-<%= provider_name %>
fi


go mod edit -require=github.com/hashicorp/terraform-provider-clean-<%= provider_name -%>@v0.0.0
go mod edit -replace github.com/hashicorp/terraform-provider-clean-<%= provider_name -%>=$(realpath ~/go/src/github.com/hashicorp/terraform-provider-clean-<%= provider_name -%>)
go run scripts/diff.go --resource $1<commit_msg>Run diff script in verbose mode (#5476)<commit_after><% autogen_exception -%>
#!/bin/bash
<% provider_name = version.nil? || version == 'ga' ? 'google' : 'google-' + version -%>
set -e
set -x
if [ -z "$1" ]; then
  echo "Must provide 1 argument - name of resource to diff, e.g. 'google_compute_forwarding_rule'"
  exit 1
fi

function cleanup() {
  go mod edit -dropreplace=github.com/hashicorp/terraform-provider-clean-<%= provider_name %>
  go mod edit -droprequire=github.com/hashicorp/terraform-provider-clean-<%= provider_name %>
}

trap cleanup EXIT
if [[ -d ~/go/src/github.com/hashicorp/terraform-provider-clean-<%= provider_name %> ]]; then
  pushd ~/go/src/github.com/hashicorp/terraform-provider-clean-<%= provider_name %>
  git clean -fdx
  git reset --hard
  git checkout master
  git pull
  popd
else
  mkdir -p ~/go/src/github.com/hashicorp
  git clone https://github.com/hashicorp/terraform-provider-<%= provider_name %> ~/go/src/github.com/hashicorp/terraform-provider-clean-<%= provider_name %>
fi


go mod edit -require=github.com/hashicorp/terraform-provider-clean-<%= provider_name -%>@v0.0.0
go mod edit -replace github.com/hashicorp/terraform-provider-clean-<%= provider_name -%>=$(realpath ~/go/src/github.com/hashicorp/terraform-provider-clean-<%= provider_name -%>)
go run scripts/diff.go --resource $1 --verbose
{'fraction_non_alphanumeric': 0.16110689916603488, 'fraction_numerical': 0.006823351023502654, 'mean_word_length': 4.154296875, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2489087', 'n_tokens_mistral': 976, 'n_tokens_neox': 940, 'n_words': 204}