-
Notifications
You must be signed in to change notification settings - Fork 1
/
utils.sh
35 lines (31 loc) · 880 Bytes
/
utils.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# check if a command exists
function command_exists() {
if command -v "$@" > /dev/null 2>&1 ; then
true
elif [ -d "/Applications/$@" ] ; then
true
else
false
fi
}
# update submodules
function update_git_submodules() {
pStep "Updating submodules"
git submodule update --init --recursive
pStepDone "Submodules updated"
}
# pretty print
function pTitle() { echo "\033[1m$@\033[0m"; }
function pStep() { echo " \033[1;33m➜\033[0m $@"; }
function pStepDone() { echo " \033[1;32m✔\033[0m $@"; }
function pGood() { echo " \033[1;32m✔\033[0m $@"; }
function pBad() { echo " \033[1;31m✖\033[0m $@"; }
function pWarning() { echo " \033[1;33m⚠︎\033[0m $@"; }
function pTest() {
pTitle Title
pStep Step
pGood Good
pWarning Warning
pBad Bad
pStepDone Step Done
}