aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/colors.sh21
-rw-r--r--lib/functions.sh18
2 files changed, 39 insertions, 0 deletions
diff --git a/lib/colors.sh b/lib/colors.sh
new file mode 100644
index 0000000..a472088
--- /dev/null
+++ b/lib/colors.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+readonly BLACK="\033[0;30m";
+readonly DARK_GRAY="\033[1;30m";
+readonly BLUE="\033[0;34m";
+readonly LIGHT_BLUE="\033[1;34m";
+readonly GREEN="\033[0;32m";
+readonly LIGHT_GREEN="\033[1;32m";
+readonly CYAN="\033[0;36m";
+readonly LIGHT_CYAN="\033[1;36m";
+readonly RED="\033[0;31m";
+readonly LIGHT_RED="\033[1;31m";
+readonly PURPLE="\033[0;35m";
+readonly LIGHT_PURPLE="\033[1;35m";
+readonly BROWN="\033[0;33m";
+readonly YELLOW="\033[1;33m";
+readonly LIGHT_GRAY="\033[0;37m";
+readonly WHITE="\033[1;37m";
+readonly BOLD="$(tput bold)";
+readonly NO_COLOR="$(tput sgr0)";
+readonly DEFAULT_COLOR="\033[0m";
diff --git a/lib/functions.sh b/lib/functions.sh
new file mode 100644
index 0000000..99a8962
--- /dev/null
+++ b/lib/functions.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+function has()
+{
+ local command_name="${1}"; shift;
+
+ set +o errexit
+ hash "${command_name}" > /dev/null 2>&1;
+ if [ 0 -eq ${?} ];
+ then
+ set -o errexit
+ return 0;
+ fi
+
+ set -o errexit
+ return 1;
+}
+