From 1404d5aaab049826898797d5a20f77ed8af54a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 26 Sep 2020 15:20:17 +0200 Subject: [PATCH] Remove dotfiles link command And my wills of making it a fully featured dotfiles handling application. By now I'm used to do that manually so heh, why not. (why did I start writing leggible commits descriptions?) --- config/scripts/dotfiles | 56 ----------------------------------------- 1 file changed, 56 deletions(-) diff --git a/config/scripts/dotfiles b/config/scripts/dotfiles index c345bbb..4d6cddf 100755 --- a/config/scripts/dotfiles +++ b/config/scripts/dotfiles @@ -154,56 +154,6 @@ function _dotfiles-install-dir { # dir # Script functions -function dotfiles_link_help { - echo "Usage: $0 link DOTFILE" - echo - echo "Arguments:" - echo " DOTFILE Path to the dotfile" - return 0 - -} -function dotfiles_link { # file - if [ -z $1 ]; then - dotfiles_link_help - return 1 - fi - absSource="$(realpath $1 2> /dev/null)" - if [[ $? != 0 || ! -e "$absSource" ]]; then - echo "[ERROR] $1: no such file or directory" - return 1 - fi - relSource="$(relativePath $DOTHOME $absSource)" - - absTarget="$DOTREPO/$relSource" - relTarget="$(relativePath "$DOTHOME/$dir" "$absTarget")" - - if [ -f "$absTarget" ]; then - echo "[ERROR/UNIMPLEMENTED] $relSource is already linked to ... something" - return 2 - fi - - if [ -f "$absSource" ]; then - if [ -d "$(dirname "$absTarget")" ]; then - cmd="mv $absSource $absTarget" - cmd2="ln --symbolic --no-dereference $relTarget $absSource" - if [ $DRY_RUN ]; then - echo $cmd - echo $cmd2 - else - $cmd - $cmd2 - fi - - else - echo "[UNIMPLEMENTED] Linking a file in a directory that don't already exists" - fi - else - echo "[UNIMPLEMENTED] Linking things other than a file" - return 12 - fi - -} - function dotfiles_install { _dotfiles-install-dir / } @@ -221,7 +171,6 @@ function dotfiles_help { echo echo "Commands:" echo " install Install dotfiles from repository" - echo " link Add dotfile to repository" echo " help Get help with commands" echo echo "Environment variables:" @@ -239,8 +188,3 @@ else dotfiles_help fi -# TODO dotfiles-{link,unlink,clean,uninstall}, better handling of DRY_RUN (use functions probably), clarify source/target thingy -# Link and Unlink should have a clever behavior regarding -# recusive folders -# Ex : linking config/i3 should make config recursible -# Ex : linking config if some files in it are linked should unlink those