emk
This commit is contained in:
parent
27db74632d
commit
3599dc7f76
30
src/emk/emk
30
src/emk/emk
@ -17,6 +17,17 @@
|
|||||||
|
|
||||||
#. /etc/emk.conf
|
#. /etc/emk.conf
|
||||||
|
|
||||||
|
am_i_root() {
|
||||||
|
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
||||||
|
printf "emk ${yellow}WARN${reset} | not running emk as root\n"
|
||||||
|
printf "emk ${yellow}WARN${reset} | THIS MAY PRODUCE UNEXPECTED RESULTS\n"
|
||||||
|
printf "emk ${yellow}WARN${reset} | however, this is NOT an error\n"
|
||||||
|
printf "emk ${yellow}WARN${reset} | and should not be treated as such.\n"
|
||||||
|
else
|
||||||
|
printf "emk ${blue}INFO${reset} | running emk as root\n"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
-h|--help)
|
-h|--help)
|
||||||
printf "emk - simple and concise build system\n"
|
printf "emk - simple and concise build system\n"
|
||||||
@ -40,16 +51,11 @@ case $1 in
|
|||||||
printf "emk ${red}ERR${reset} | failed to get help from emkfile.\n"
|
printf "emk ${red}ERR${reset} | failed to get help from emkfile.\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
./emkfile $2
|
||||||
|
if [ "$?" != "0" ]; then
|
||||||
|
printf "emk ${red}ERR${reset} | subproccess finished with non-zero status.\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Check for root
|
|
||||||
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
|
||||||
printf "emk ${yellow}WARN${reset} | not running emk as root\n"
|
|
||||||
printf "emk ${yellow}WARN${reset} | THIS MAY PRODUCE UNEXPECTED RESULTS\n"
|
|
||||||
printf "emk ${yellow}WARN${reset} | however, this is NOT an error\n"
|
|
||||||
printf "emk ${yellow}WARN${reset} | and should not be treated as such.\n"
|
|
||||||
else
|
|
||||||
printf "emk ${blue}INFO${reset} | running emk as root\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
./emkfile $2
|
|
||||||
|
9
src/emk/emk.conf
Executable file
9
src/emk/emk.conf
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
# /etc/emk.conf
|
||||||
|
|
||||||
|
# Colors
|
||||||
|
export red="\033[1;31m"
|
||||||
|
export green="\033[1;32m"
|
||||||
|
export blue="\033[1;34m"
|
||||||
|
export reset="\033[m"
|
||||||
|
|
||||||
|
# end /etc/emk.conf
|
Loading…
Reference in New Issue
Block a user