Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

provision: Refuse to run outside an existing Vagrant environment.

Anders Kaseorg2c27a87bcd3d
diff --git a/tools/provision b/tools/provision
index e79d7170d29..e4b3db52c68 100755
--- a/tools/provision
+++ b/tools/provision
@@ -10,6 +10,13 @@ if [ "$EUID" -eq 0 ]; then
exit 1
fi
+if [ -e "$(dirname "${BASH_SOURCE[0]}")/../.vagrant" ] && [ ! -e /home/vagrant ]; then
+ echo 'Error: provision should be run inside the Vagrant environment.' >&2
+ # shellcheck disable=SC2016
+ echo 'Try `vagrant up --provision`.' >&2
+ exit 1
+fi
+
os="$(. /etc/os-release && echo "$ID $VERSION_ID")"
case "$os" in
'ubuntu 14.04' | 'ubuntu 16.04')