Skip to content

Instantly share code, notes, and snippets.

@TheDauthi
Created February 25, 2015 02:17
Show Gist options
  • Save TheDauthi/734d4d91ab41fd56d858 to your computer and use it in GitHub Desktop.
Save TheDauthi/734d4d91ab41fd56d858 to your computer and use it in GitHub Desktop.
Find PORT settings inside foreman .env files.
find /srv/git -iname HEAD -prune -execdir sh -c 'git ls-tree -r HEAD --name-only | grep .env | xargs -I{} sh -c "git cat-file blob master:{} | awk -vREPO=$(pwd) -vFILE={} -vSEP=\# \"{ print REPO SEP FILE, \\\$0 }\" " ' \; | grep PORT | awk '{print $2, $1}' | sed -e 's/\/srv\/git\///' -e 's/.git\#.*//' | sort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment