summaryrefslogtreecommitdiff
path: root/utils.sh
diff options
context:
space:
mode:
authorAndreas Maunz <andreas@maunz.de>2011-04-01 14:03:51 +0200
committerAndreas Maunz <andreas@maunz.de>2011-04-01 14:03:51 +0200
commitde9c1794db7419da642398ac41975a282ca92dd1 (patch)
tree68d1306fe506559eb44b103ec88e86ab357fcd33 /utils.sh
parent0b0dafd700dce8ab635038dac68255be1897eb04 (diff)
all
Diffstat (limited to 'utils.sh')
-rw-r--r--utils.sh23
1 files changed, 17 insertions, 6 deletions
diff --git a/utils.sh b/utils.sh
index 0cdbc69..07d8d73 100644
--- a/utils.sh
+++ b/utils.sh
@@ -1,17 +1,19 @@
#!/bin/bash
-function check_dest {
- if ! [ -d $PREFIX ]; then
- if ! mkdir -p $PREFIX; then
+check_dest()
+{
+ if ! [ -d "$PREFIX" ]; then
+ if ! mkdir -p "$PREFIX"; then
echo "Could not create target directory '$PREFIX'! Aborting..."
exit 1
fi
fi
}
-function run_cmd {
- local cmd=$1
- local title=$2
+run_cmd ()
+{
+ local cmd="$1"
+ local title="$2"
if ! eval $cmd >>$LOG 2>&1 ; then
printf "%25s%15s\n" "'$title'" "FAIL"
@@ -21,5 +23,14 @@ function run_cmd {
}
+abs_path()
+{
+ local path="$1"
+ case "$path" in
+ /*) absolute=1 ;;
+ *) absolute=0 ;;
+ esac
+}
+
check_dest
source ~/.bashrc