home
·
contact
·
privacy
projects
/
config
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve symlink script.
[config]
/
all_new_2018
/
symlink_etc.sh
diff --git
a/all_new_2018/symlink_etc.sh
b/all_new_2018/symlink_etc.sh
index f1f97af1a557a27b5a5d51fdce500cda02c7cd23..edee563182d1d02fa3b320bb5bca4dd4e0a0fec8 100755
(executable)
--- a/
all_new_2018/symlink_etc.sh
+++ b/
all_new_2018/symlink_etc.sh
@@
-6,7
+6,7
@@
set -e
target="$1"
set -e
target="$1"
-if [ ! "${target}" = "all" ] && [ ! "$target}" = "server" ]; then
+if [ ! "${target}" = "all" ] && [ ! "$
{
target}" = "server" ]; then
echo "Need proper target."
false
fi
echo "Need proper target."
false
fi
@@
-14,7
+14,9
@@
fi
config_tree_prefix="${HOME}/config/all_new_2018/linkable_etc_files/"
cd "${config_tree_prefix}""${target}"
for path in $(find . -type f); do
config_tree_prefix="${HOME}/config/all_new_2018/linkable_etc_files/"
cd "${config_tree_prefix}""${target}"
for path in $(find . -type f); do
- src=$(echo "${path}" | cut -c2-)
- dest=$(realpath "${path}")
- ln -fs "${dest}" "${src}"
+ linking=$(echo "${path}" | cut -c2-)
+ linked=$(realpath "${path}")
+ dir=$(dirname "${linking}")
+ mkdir -p "${dir}"
+ ln -fs "${linked}" "${linking}"
done
done