lib/update.utils
branchdns-new
changeset 85 4ad9c9b7cd0e
parent 83 5a83f2abc0dd
child 87 cb4607af8663
--- a/lib/update.utils	Tue Dec 17 01:17:49 2013 +0200
+++ b/lib/update.utils	Tue Dec 17 02:06:53 2013 +0200
@@ -30,7 +30,7 @@
 #
 # Output is kept on stdout, exit status is that of the given command.
 function indent () {
-    local indent=$1; shift
+    local indent="$1"; shift
 
     "$@" | sed "s/^/$indent/"
 
@@ -41,11 +41,11 @@
 ### FS utils
 # Create dir if not exists.
 function ensure_dir {
-    local dir=$1
+    local dir="$1"
 
-    if [ ! -d $dir ]; then
+    if [ ! -d "$dir" ]; then
         log_warn "Creating output dir: $dir"
-        cmd mkdir $dir
+        cmd mkdir "$dir"
     fi
 }
 
@@ -55,7 +55,7 @@
 #
 # XXX: improve...?
 function abspath () {
-    local path=$1
+    local path="$1"
 
     echo "$SRV/$path"
 }
@@ -65,13 +65,13 @@
 #   list_files $dir $glob
 #
 function list_files {
-    local dir=$1
-    local glob=${2:-*}
+    local dir="$1"
+    local glob="${2:-*}"
     local name=
 
     for file in $dir/$glob; do
         # only files
-        [ -f $file ] || continue
+        [ -f "$file" ] || continue
 
         # strip prefix
         name=${file#$dir/}