I've got a very basic pre-commit
-hook with the following code in it:
#!/usr/bin/env bash
vagrant ssh -c "/var/www/public/tests.sh"
But whenever I try to commit I get the following message:
.git/hooks/pre-commit: line 2: vagrant: command not found
Vagrant is installed and it is running. If I execute the command manually it works, only if Git tries to run it, it doesn't.
I already tried the following:
- Add an extra script
pre-commit.sh
in the root of my project and calling that from the pre-commit hook. - Added absolute path to Vagrant binary in my pre-commit hook, but then I get the message my virtual box is not running (although it is).