Homestead bash helper

One thing that annoys me about homestead is that I have to switch to the Homestead directory in order to use vagrant.

1
2
cd $HOMESTEAD_DIR;
vagrant up

Instead I made a little helper that takes out a step. Now I can just run

1
homestead up

Below is the script. I placed mine in ~/.bin/homestead

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

ARGS="$@"
COMMAND="$1"
HOMESTEAD_DIR="$HOME/.homestead/Homestead"

cd $HOMESTEAD_DIR

case $COMMAND in

edit)
vi $HOME/.homestead/Homestead.yaml
;;

down)
vagrant halt
;;

*)
vagrant $ARGS
;;

esac