Skip to content

Instantly share code, notes, and snippets.

@C-Saunders
Created January 23, 2020 18:23
Show Gist options
  • Save C-Saunders/5d7b4d4fc8c20d6f2625aa3a7c07d6fb to your computer and use it in GitHub Desktop.
Save C-Saunders/5d7b4d4fc8c20d6f2625aa3a7c07d6fb to your computer and use it in GitHub Desktop.
List Heroku buildpacks for each app using the Heroku CLI.
#! /bin/bash
app_list=$(heroku apps -A -t=${@} | grep -v '^===')
for app in $app_list; do
buildpacks=$(heroku buildpacks -a $app | grep -v '^===' | sed -E 's/[0-9]+\. //')
if [[ $buildpacks =~ "has no Buildpack URL set" ]]; then
echo $app "has no buildpacks"
else
for buildpack in $buildpacks; do
echo $app ">>" $buildpack
done
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment