Skip to content

Instantly share code, notes, and snippets.

@r35krag0th
Created April 26, 2023 16:51
Show Gist options
  • Save r35krag0th/f0c73f78939e2ff8600be01c7b00805f to your computer and use it in GitHub Desktop.
Save r35krag0th/f0c73f78939e2ff8600be01c7b00805f to your computer and use it in GitHub Desktop.
Downloads and checks codesigning on all TF Versions using TFSwitch
#!/usr/bin/env zsh
declare -a major_minors
major_minors=(
0.11
0.12
0.13
0.14
0.15
1.0
1.1
1.2
1.3
1.4
)
for short_version in ${major_minors[@]}; do
LATEST=$(tfswitch -s ${short_version}.0 | grep -E '^Matched version:' | grep -E '(\d.\d{1,}.\d{1,})$' --only-matching | cut -d. -f3)
echo -e "\033[32m>>>\033[0m Latest for \033[1m${short_version}\033[0m is \033[1m${short_version}.${LATEST}\033[0m"
for patch_version in {0..${LATEST}}; do
tfswitch "${short_version}.${patch_version}"
done
echo ""
done
echo -e "\033[32m>>>\033[0m Checking code signing on downloaded versions"
find ~/.terraform.versions \
-name 'terraform_*' \
-type f \
-exec codesign -v {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment