We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
run-in-vagrant
1 parent 3fd8fae commit 8984af9Copy full SHA for 8984af9
1 file changed
run-in-vagrant
@@ -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
0 commit comments