MAKEFILE - Check if Root

Added a check to the top-level Makefile to ensure that it has not been
invoked by ID 0 i.e. `root` or `sudo`.

Resolves #1100.

Signed-off-by: Jake Mercer <jake.mercer@civica.co.uk>
This commit is contained in:
Jake Mercer 2019-10-20 00:38:34 +01:00
parent 6b09b5c50b
commit 638c174962
1 changed files with 5 additions and 0 deletions

View File

@ -1,6 +1,11 @@
SHELL = bash
ALL_EXCLUDE = third_party .git env build
# Check if root
ifeq ($(shell id -u),0)
$(error ERROR: Running as ID 0)
endif
# Tools + Environment
IN_ENV = if [ -e env/bin/activate ]; then . env/bin/activate; fi;
env: