diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2018-05-23 23:01:10 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2018-05-23 23:01:10 +0300 |
commit | 6c0afd8deba7a1b411e10d34e40835388cf39ba3 (patch) | |
tree | a24d80af0a031c086a4d75574de9ed808967db06 /update.sh | |
parent | cygwin-home is linux-home now (diff) | |
download | config-links-6c0afd8deba7a1b411e10d34e40835388cf39ba3.tar.gz config-links-6c0afd8deba7a1b411e10d34e40835388cf39ba3.zip |
bash best practices
Diffstat (limited to 'update.sh')
-rwxr-xr-x | update.sh | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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 |