aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2018-05-23 23:01:10 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2018-05-23 23:01:10 +0300
commit6c0afd8deba7a1b411e10d34e40835388cf39ba3 (patch)
treea24d80af0a031c086a4d75574de9ed808967db06
parentcygwin-home is linux-home now (diff)
downloadconfig-links-6c0afd8deba7a1b411e10d34e40835388cf39ba3.tar.gz
config-links-6c0afd8deba7a1b411e10d34e40835388cf39ba3.zip
bash best practices
-rwxr-xr-xupdate.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/update.sh b/update.sh
index 782b641..77a48a1 100755
--- a/update.sh
+++ b/update.sh
@@ -224,7 +224,10 @@ update_database_path() {
fi
db_path="$( traverse_path --file -- "$1" )"
- mkdir -p -- "$( dirname -- "$db_path" )"
+
+ local db_dir
+ db_dir="$( dirname -- "$db_path" )"
+ mkdir -p -- "$db_dir"
}
ensure_database_exists() {
@@ -375,7 +378,9 @@ discover_new_entries() {
is_dry_run && continue
- mkdir -p -- "$( dirname -- "$symlink_path" )"
+ local symlink_dir
+ symlink_dir="$( dirname -- "$symlink_path" )"
+ mkdir -p -- "$symlink_dir"
ln -f -s --no-target-directory -- "$shared_path" "$symlink_path"
database[$entry]=1