Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
## Tom's Magical "Don't Mate Your Root" Script
# Prevents "mate /" from crashing your Mac.
function mateforce(){
`which mate` $*
}
function line_count_less_than(){
ruby -e "
max_count = ARGV.first.to_i
count = 0
while STDIN.gets
count += 1
exit 1 if count > max_count
end
exit 0
" $*
}
function mate(){
if find $* -type f | grep -v '.git' | line_count_less_than 10000
then
mateforce $*
else
echo "Too many files!"
echo "If you are sure you wish to do this, then please use mateforce"
false
fi
}
function m(){
if [ -z $1 ]
then
mate .
else
mate $*
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.