mirror of
https://github.com/DictXiong/dotfiles.git
synced 2025-04-24 17:16:53 +08:00
dfs reset; create_symlink check
This commit is contained in:
parent
f48d0912f9
commit
55a92f58ed
12
.zshrc2
12
.zshrc2
|
@ -65,8 +65,16 @@ export DOTFILES=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
|
|||
dfs()
|
||||
{
|
||||
case $1 in
|
||||
update ) (cd "$DOTFILES" && env git pull) ;;
|
||||
* ) echo "unknown command \"$1\". available: update" ;;
|
||||
update ) (cd "$DOTFILES" && git pull) ;;
|
||||
reset )
|
||||
antigen reset 1> /dev/null
|
||||
rm -rf $HOME/.antigen
|
||||
$DOTFILES/install.sh -r
|
||||
dfs update
|
||||
$DOTFILES/install.sh -i
|
||||
echo 'Done. Please open a new shell to see the changes.'
|
||||
;;
|
||||
* ) echo "unknown command \"$1\". available: update, reset" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
|
|
@ -141,6 +141,9 @@ create_symlink()
|
|||
return 1
|
||||
fi
|
||||
if [ -f "$dest" ]; then
|
||||
if [ "$(readlink $dest)" -ef "$src" ]; then
|
||||
return 0
|
||||
fi
|
||||
fmt_warning "\"$dest\" already exists! stat output:"
|
||||
echo ----------
|
||||
stat $dest
|
||||
|
@ -154,6 +157,7 @@ create_symlink()
|
|||
fi
|
||||
fi
|
||||
ln -s $src $dest
|
||||
return $?
|
||||
}
|
||||
|
||||
delete_link_if_match()
|
||||
|
|
Loading…
Reference in New Issue
Block a user