mirror of
https://github.com/lloeki/dotfiles.git
synced 2025-12-06 07:24:39 +01:00
Clean setup
This commit is contained in:
parent
54e03df8a6
commit
fefe99ae9f
2 changed files with 9 additions and 7 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
# dotfiles locations
|
# dotfiles locations
|
||||||
DOTFILES_HOME_DIR="$(cd -P "$(dirname "$(readlink ~/.dotfilesrc)")" && pwd)"
|
DOTFILES_HOME_DIR="$(cd -P "$(dirname "$(readlink ~/.dotfilesrc)")" && pwd)"
|
||||||
DOTFILES_ROOT_DIR="$( dirname "$DOTFILES_HOME_DIR" )"
|
DOTFILES_ROOT_DIR="$(dirname "$DOTFILES_HOME_DIR")"
|
||||||
DOTFILES_ZSH_DIR="$DOTFILES_ROOT_DIR/zsh"
|
DOTFILES_ZSH_DIR="$DOTFILES_ROOT_DIR/zsh"
|
||||||
DOTFILES_BASH_DIR="$DOTFILES_ROOT_DIR/bash"
|
DOTFILES_BASH_DIR="$DOTFILES_ROOT_DIR/bash"
|
||||||
DOTFILES_SHELL_DIR="$DOTFILES_ROOT_DIR/shell"
|
DOTFILES_SHELL_DIR="$DOTFILES_ROOT_DIR/shell"
|
||||||
|
|
|
||||||
14
setup.sh
14
setup.sh
|
|
@ -1,17 +1,19 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
[ $(pwd) = "$HOME/.dotfiles" ] || ln -sfn "$(pwd)" "$HOME/.dotfiles"
|
|
||||||
|
|
||||||
for file in home/*; do
|
for file in home/*; do
|
||||||
dotfile="$(basename "$file")"
|
dotfile="$(basename "$file")"
|
||||||
case "${dotfile}" in
|
case "${dotfile}" in
|
||||||
Makefile|*.md|LICENSE|setup.sh)
|
Makefile|*.md|LICENSE|setup.sh)
|
||||||
# NOOP
|
: # NOOP
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# link the file with a leading dot
|
if [ -d "${dotfile}" ]; then
|
||||||
echo "linking ${dotfile}"
|
:
|
||||||
ln -sf "$(pwd)/${file}" "$HOME/.${dotfile}"
|
else
|
||||||
|
# link the file with a leading dot
|
||||||
|
echo "linking ${dotfile}"
|
||||||
|
ln -sf "${PWD}/${file}" "$HOME/.${dotfile}"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue