Skip to content

Commit 8984af9

Browse files
committed
WIP copy of run-in-vagrant.
1 parent 3fd8fae commit 8984af9

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

run-in-vagrant

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
3+
#---------------------------------------------------------------------
4+
usage ()
5+
{
6+
cat <<EOT
7+
8+
${0##*/}
9+
Executes the provided arguments inside the current vagrant VM,
10+
if present. Otherwise just executes the arguments. The entire
11+
command string MUST be quoted. All paths used must be relative
12+
to the root project folder shared between the host and VM.
13+
14+
Usage:
15+
bin/${0##*/} "Command [--with args]"
16+
17+
EOT
18+
19+
exit 0
20+
}
21+
if [ "$1" = '-h' ]; then
22+
usage
23+
fi
24+
25+
echo "@TODO: WIP"
26+
exit 1
27+
28+
29+
if mount | grep -q '^/vagrant'; then
30+
vagrant ssh -c "cd /vagrant; $@"
31+
else
32+
eval "$@"
33+
fi

0 commit comments

Comments
 (0)