structured main routines. implement file reporter

This commit is contained in:
Patrick Stadler
2015-03-08 20:37:56 +01:00
parent c54c9d73b7
commit 9858beb329
12 changed files with 213 additions and 138 deletions

7
lib/utils/helpers.sh Normal file
View File

@@ -0,0 +1,7 @@
is_number () {
[ ! -z "$1" ] && printf '%f' "$1" &>/dev/null
}
iso_date () {
date -u +"%Y-%m-%dT%H:%M:%SZ"
}

View File

@@ -14,11 +14,13 @@ is_linux () { [ $OS_TYPE == 'solaris' ]; }
is_bsd () { [ $OS_TYPE == 'bsd']; }
is_unknown () { [ $OS_TYPE == 'unknown' ]; }
make_temp_dir () {
if is_osx; then
# http://unix.stackexchange.com/a/84980/50905
if is_osx; then
make_temp_dir () {
mktemp -d -t 'sysmetrics'
else
}
else
make_temp_dir () {
mktemp -d
fi
}
}
fi