Create missing target directory on setup.
This commit is contained in:
@@ -66,6 +66,7 @@ while IFS= read -d $'\0' -r folder ; do
|
|||||||
fi
|
fi
|
||||||
mapping="$(get_mapping "$folder")"
|
mapping="$(get_mapping "$folder")"
|
||||||
|
|
||||||
|
|
||||||
source_folder="$(path_combine "$config_dir" "$folder")"
|
source_folder="$(path_combine "$config_dir" "$folder")"
|
||||||
[[ "$(ls "$source_folder")" ]] || continue
|
[[ "$(ls "$source_folder")" ]] || continue
|
||||||
for file in "$source_folder"/* ; do
|
for file in "$source_folder"/* ; do
|
||||||
@@ -86,6 +87,9 @@ while IFS= read -d $'\0' -r folder ; do
|
|||||||
(( $dryrun )) || mv "$destination" "$backup_destination"
|
(( $dryrun )) || mv "$destination" "$backup_destination"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ ! -e "$(dirname "$destination")" ]] ; then
|
||||||
|
mkdir "$(dirname "$destination")"
|
||||||
|
fi
|
||||||
[[ -e "$destination" ]] && [[ "$(readlink "$destination")" == "$file" ]] && continue
|
[[ -e "$destination" ]] && [[ "$(readlink "$destination")" == "$file" ]] && continue
|
||||||
echo "ln -sf \"$file\" -> \"$destination\""
|
echo "ln -sf \"$file\" -> \"$destination\""
|
||||||
(( $dryrun )) || ln -sf "$file" "$destination"
|
(( $dryrun )) || ln -sf "$file" "$destination"
|
||||||
|
|||||||
Reference in New Issue
Block a user