From b19688516c68862bdb24839e568f1e74947b7fa2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 14 Aug 2013 14:53:53 -0400 Subject: mv .config/symlinks.sh .local/bin/config-symlinks --- .config/symlinks.sh | 15 --------------- .local/bin/config-symlinks | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) delete mode 100755 .config/symlinks.sh create mode 100755 .local/bin/config-symlinks diff --git a/.config/symlinks.sh b/.config/symlinks.sh deleted file mode 100755 index a3db6ae..0000000 --- a/.config/symlinks.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -sed -e '/^\s*$/d' -e '/#/d' symlinks | while read _path _link; do - path="$(sed -rn 's|[^/]+/|../|g;s|/[^/]+$|/|p' <<<"$_link")${_path}" - link="$HOME/$_link" - if [[ -L "$link" ]]; then - rm -f "$link" - fi - if [[ -e "$link" ]]; then - echo "ERROR: file exists: $link" >> /dev/stderr - else - mkdir -p "${link%/*}" - ln -s "$path" "$link" - fi -done diff --git a/.local/bin/config-symlinks b/.local/bin/config-symlinks new file mode 100755 index 0000000..0831ca3 --- /dev/null +++ b/.local/bin/config-symlinks @@ -0,0 +1,15 @@ +#!/bin/bash + +sed -e '/^\s*$/d' -e '/#/d' symlinks | while read _target _link; do + target="$(sed -rn 's|[^/]+/|../|g;s|/[^/]+$|/|p' <<<"$_link")${_target}" + link="$HOME/$_link" + if [[ -L "$link" ]]; then + rm -f "$link" + fi + if [[ -e "$link" ]]; then + echo "ERROR: file exists: $link" >> /dev/stderr + else + mkdir -p "${link%/*}" + ln -s "$target" "$link" + fi +done -- cgit v1.2.3