From: Christian Heller Date: Wed, 25 Jan 2017 01:47:30 +0000 (+0100) Subject: Fix buggy add_dir script. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/calendar?a=commitdiff_plain;h=ba1a088a6e6aacd9fb4f94433d95ab53c8feca83;p=redo-blog Fix buggy add_dir script. --- diff --git a/add_dir.sh b/add_dir.sh index b8e04bd..14d2c7a 100755 --- a/add_dir.sh +++ b/add_dir.sh @@ -3,8 +3,8 @@ set -e link_files_in_dir () { - srcdir="$1" - for file in "$srcdir"/* "$srcdir"/.*; do + local parent_dir="$1" + for file in "$parent_dir"/* "$parent_dir"/.*; do if [ -f "$file" ]; then set +e ln -s "$file" @@ -15,13 +15,13 @@ link_files_in_dir () { dir=$(basename "$file") mkdir -p "$dir" cd "$dir" - link_files_in_dir "$srcdir/$dir" + link_files_in_dir "$parent_dir/$dir" cd .. fi done } -srcdir=`pwd`/processor +src_dir=`pwd`/processor mkdir -p "$1" cd "$1" -link_files_in_dir "$srcdir" +link_files_in_dir "$src_dir"