Skip to content

Instantly share code, notes, and snippets.

@xiii
Created April 29, 2014 23:20
Show Gist options
  • Save xiii/044b4fe2d08cfc63d69e to your computer and use it in GitHub Desktop.
Save xiii/044b4fe2d08cfc63d69e to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ $# -eq 0 ]
then
echo "Please provide an ERB file as argument eg $0 file.erb"
exit 1
fi
erb -P -x -T '-' $1 | ruby -c
if [[ $? -ne 0 ]]
then
echo "$1 is not valid ERB"
exit 1
else
echo "$1 is a valid ERB"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment