arfoll / unrarall

bash script to unrar everything and cleanup in a given directory
GNU General Public License v3.0
261 stars 68 forks source link

Make the find command configurable #20

Closed mattmackenzie closed 9 years ago

mattmackenzie commented 9 years ago

If a user installs findutils on mac os x, they can leave findutils unlinked by using /usr/local/bin/gfind

mattmackenzie commented 9 years ago

Helps to address #18

delcypher commented 9 years ago

This looks reasonable to me.

This is better than what we have now but it requires that a user already knows they need to change the version of find. It would be better if we also checked at start up what version of find is being used and if it is not a GNU version just exit with an error message.

mattmackenzie commented 9 years ago

It's a quick fix for now that at least isn't too stinky. If I get a minute I'll see about trying to detect GNU find.

On Jun 13, 2015, at 7:49 PM, Dan Liew notifications@github.com wrote:

This looks reasonable to me.

This is better than what we have now but it requires that a user already knows they need to change the version of find. It would be better if we also checked at start up what version of find is being used and if it is not a GNU version just exit with an error message.

— Reply to this email directly or view it on GitHub.

mattmackenzie commented 9 years ago
if [[ $OSTYPE == darwin* ]]; then 
    type -P gfind &>/dev/null && FIND=gfind || echo "Please install fileutils using Home Brew."; exit 1;

fi

^^ works on linux and mac and can probably be adapted to other BSD flavours. I don't have access to any of them.

delcypher commented 9 years ago

@mattmackenzie The above looks reasonable. The only thing I would change is instead of using echo is to use message error "Please install..." which is function defined in unrarall which is designed for error messages.

mattmackenzie commented 9 years ago

@delcypher Ok, I have added that with your suggestion.

delcypher commented 9 years ago

LGTM