Add install script to symlink scripts
This commit is contained in:
34
install.sh
Executable file
34
install.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
symlink() {
|
||||
local source=$1
|
||||
local dest=$2
|
||||
mkdir -p $(dirname $dest)
|
||||
if [ -L $dest ]; then
|
||||
local target=`readlink $dest`
|
||||
if [ "$target" != "$source" ]; then
|
||||
rm $dest
|
||||
ln -s $source $dest
|
||||
echo changed replace incorrect symlink $dest
|
||||
fi
|
||||
elif [ -f $dest ]; then
|
||||
error symlink failed $dest exists but is a regular file
|
||||
else
|
||||
ln -s $source $dest
|
||||
echo changed created symlink $dest
|
||||
fi
|
||||
}
|
||||
|
||||
symlink ~/.config/git/_git-changes \
|
||||
~/.local/share/zsh/site-functions/_git-changes
|
||||
|
||||
symlink ~/.config/git/git-sync \
|
||||
~/.local/bin/git-sync
|
||||
|
||||
symlink ~/.config/git/git-find-merged \
|
||||
~/.local/bin/git-find-merged
|
||||
|
||||
symlink ~/.config/git/git-ls-ignored \
|
||||
~/.local/bin/git-ls-ignored
|
||||
symlink ~/.config/git/_git-ls-ignored \
|
||||
~/.local/share/zsh/site-functions/_git-ls-ignored
|
||||
Reference in New Issue
Block a user