2017-03-10 10:42:12 +00:00
|
|
|
function __bash_basedir {
|
|
|
|
local full=$(pwd)
|
2017-10-05 11:17:39 +00:00
|
|
|
if [ "$full" == "/" ]
|
2017-03-10 10:42:12 +00:00
|
|
|
then
|
|
|
|
echo $full
|
|
|
|
else
|
|
|
|
echo $full | rev | cut -d/ -f1 | rev
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function __bash_escape {
|
|
|
|
echo -ne "\e[$1m"
|
|
|
|
}
|
|
|
|
|
|
|
|
function __bash_is_empty {
|
2017-10-05 11:17:39 +00:00
|
|
|
if [ "$1" == "" ]
|
|
|
|
then
|
|
|
|
return 0
|
|
|
|
else
|
|
|
|
return 1
|
|
|
|
fi
|
2017-03-10 10:42:12 +00:00
|
|
|
}
|