This works:
vagrant ssh
cd /vagrant && grunt build
This doesn't:
vagrant ssh -c 'cd /vagrant && grunt build'
(exits with bash: grunt: command not found
)
Why?
Reason I'm asking is that I have a shell script that deploys a site to GitHub Pages, and I wanted to add a build step at the beginning to get a fresh build right before deployment.
I also tried writing a shell script vagrant_build.sh
like:
cd /vagrant
grunt build
and having vagrant run it with vagrant ssh -c 'bash /vagrant/vagrant_build.sh'
, but it still can't find grunt
.
The docs say that vagrant ssh -c COMMAND
runs a single command, do I need to take that 100% literally? I was interpreting it as 'anything you can fit in one line in a terminal'.
because grunt
is not in your vagrant
's path. so give it absolute path.
cd /vagrant && /path/to/grunt build
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With