.
This commit is contained in:
commit
4603184052
87 changed files with 3677 additions and 0 deletions
38
setup.sh
Executable file
38
setup.sh
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if ! which lr >/dev/null 2>&1; then
|
||||
>&2 echo "install leah2's lr(1) first"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test ! -d './files'; then
|
||||
>&2 echo "This script has to be executed from the dotfiles root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd files
|
||||
|
||||
lr -U -t 'path~~".*"' |
|
||||
while read -r path; do
|
||||
if test -d "$path"; then
|
||||
if test -d "$HOME/$path"; then
|
||||
>&2 echo "[-] $path already set up"
|
||||
continue
|
||||
fi
|
||||
|
||||
mkdir -p "$HOME/$path"
|
||||
echo "[x] created dir $HOME/$path"
|
||||
continue
|
||||
else
|
||||
if test -L "$HOME/$path"; then
|
||||
>&2 echo "[-] $path already set up"
|
||||
continue
|
||||
fi
|
||||
|
||||
ln -fs "$(realpath "$path")" "$HOME/$path"
|
||||
echo "[x] created symlink $path -> $HOME/$path"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "done"
|
||||
Loading…
Add table
Add a link
Reference in a new issue