diff options
author | Urbain Vaes <urbain@vaes.uk> | 2016-04-19 15:24:25 +0100 |
---|---|---|
committer | Urbain Vaes <urbain@vaes.uk> | 2016-04-19 15:24:25 +0100 |
commit | e146e947c52ac4adbe426b3f893faff1e46ed5f8 (patch) | |
tree | 1605bf4eb78cc619988c92632f3cee2a56143fd5 /bin/dot | |
parent | 83bd503208d45fa837348441196dd07223b13e3e (diff) |
Use GNU stow for dotfiles management
Diffstat (limited to 'bin/dot')
-rwxr-xr-x | bin/dot | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/bin/dot b/bin/dot deleted file mode 100755 index acb0e64..0000000 --- a/bin/dot +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash - -get_links() -{ - find $HOME -not -path "$HOME/dotfiles/*" -type l | while read line; do - if [[ "$(realpath -q $line)" == "${HOME}/dotfiles/"* ]]; then - echo $line - fi - done -} - -clean() -{ - get_links | while read link; do - rm -v ${link} - done -} - -down() -{ - source $HOME/dotfiles/.dotmap - for link in "${!dotmap[@]}"; do - echo "Removing ${link}." - rm -rf $link - done -} - -up() -{ - source $HOME/dotfiles/.dotmap - for link in "${!dotmap[@]}"; do - target=${dotmap[$link]} - mkdir -p $(dirname ${link}) - echo "Linking $target." - rm -rf $link && ln -s $target $link - done -} - -save() -{ - echo "declare -A dotmap" > .dotmap - get_links | while read link; do - echo "dotmap[$link]=$(readlink -f -q $link)" | sed "s#$HOME#"'$HOME#g' >> .dotmap - done - sort .dotmap -o .dotmap -} - -$1 |