forked from rddill-IBM/ZeroToBlockchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon_OSX.sh
executable file
·36 lines (31 loc) · 861 Bytes
/
common_OSX.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
36
#!/bin/bash
YELLOW='\033[1;33m'
RED='\033[1;31m'
GREEN='\033[1;32m'
RESET='\033[0m'
# indent text on echo
function indent() {
c='s/^/ /'
case $(uname) in
Darwin) sed -l "$c";;
*) sed -u "$c";;
esac
}
OS=$(uname)
export OS=$OS
# displays where we are, uses the indent function (above) to indent each line
function showStep ()
{
echo -e "${YELLOW}=====================================================" | indent
echo -e "${RESET}-----> $*" | indent
echo -e "${YELLOW}=====================================================${RESET}" | indent
}
# Grab the current directory
function getCurrent()
{
showStep "getting current directory"
DIR="$( pwd )"
echo "DIR in getCurrent is: ${DIR}"
THIS_SCRIPT=`basename "$0"`
showStep "Running '${THIS_SCRIPT}'"
}