gael-ian / vagrant-bindfs

A Vagrant plugin to automate bindfs mount in the VM
MIT License
482 stars 37 forks source link

Fix for finding bindfs fullt path w/ bash hashing #67

Closed herebebogans closed 7 years ago

herebebogans commented 7 years ago

The 3rd column output is "hashed" when the bindfs in path is already hashed. (See man type).

eg

$ type bindfs | cut -d" " -f3 hashed

My fix

$ type -p bindfs | cut -d" " -f3 /usr/bin/bindfs

gael-ian commented 7 years ago

Hi @herebebogans,

I can't merge this pull request for the moment as I'm far away from my computer until the beginning of January.

Can you please ensure that your fix works for every supported platform (even MacOS and its particular shell), with both hashed and non hashed bindfs command ? See the Contributing section of the README for details on how to run your tests.

Thanks for your contribution.

herebebogans commented 7 years ago

Will do

gael-ian commented 7 years ago

Hi @herebebogans

type -P seems to be supported by every version of bash, even on OS X, and always trigger a PATH search to return the name of the file to be executed, either the command is being hashed or not. It looks like a good solution to this issue.

I did some other enhancement on your contribution, to deal with the case where bindfs is not installed and type return a non-zero exit code and to be sure the command will be invoked through Bash as type is a shell builtin.

A new version of vagrant-bindfs will be release in minutes and include this fix.

Thank you for contributing and happy new year.