ringohub
6/25/2016 - 7:36 AM

Inject variables into a homebrew formula.

Inject variables into a homebrew formula.

f='() {eval "$(echo "cat <<EOF\\n$(cat $1)\\nEOF")"}' \
		version=\$(grep "# @version" foo | cut -d ' ' -f 3) \
  	website=\$(grep "# @website" foo | cut -d ' ' -f 3) \
  	sha256=\$(shasum -a 256 foo | cut -d ' ' -f 1) \
  	eval $f formula > foo.rb