mirror of
https://github.com/DictXiong/dotfiles.git
synced 2025-04-24 21:46:52 +08:00
zshrc: dfs config
This commit is contained in:
parent
bd4e11dad5
commit
59a1dda958
8
.zshrc2
8
.zshrc2
|
@ -142,7 +142,13 @@ bindkey "\ed" delete-char # alt+d
|
||||||
dfs()
|
dfs()
|
||||||
{
|
{
|
||||||
case $1 in
|
case $1 in
|
||||||
|
cd ) cd "$DOTFILES" ;;
|
||||||
update ) "$DOTFILES/update.sh" ;;
|
update ) "$DOTFILES/update.sh" ;;
|
||||||
|
version ) (cd "$DOTFILES" && git rev-parse HEAD) ;;
|
||||||
|
config )
|
||||||
|
mkdir -p ~/.config/dotfiles
|
||||||
|
$EDITOR ~/.config/dotfiles/env
|
||||||
|
;;
|
||||||
force-update ) (
|
force-update ) (
|
||||||
cd "$DOTFILES"
|
cd "$DOTFILES"
|
||||||
git fetch --all
|
git fetch --all
|
||||||
|
@ -150,7 +156,6 @@ dfs()
|
||||||
for i in $(git for-each-ref refs/heads --format='%(refname)') ; do git checkout ${i#refs/heads/} ; git pull --ff-only ; done
|
for i in $(git for-each-ref refs/heads --format='%(refname)') ; do git checkout ${i#refs/heads/} ; git pull --ff-only ; done
|
||||||
git checkout -c advice.detachedHead=false $ref)
|
git checkout -c advice.detachedHead=false $ref)
|
||||||
;;
|
;;
|
||||||
version ) (cd "$DOTFILES" && git rev-parse HEAD) ;;
|
|
||||||
reset )
|
reset )
|
||||||
antigen reset 1> /dev/null
|
antigen reset 1> /dev/null
|
||||||
rm -rf $HOME/.antigen
|
rm -rf $HOME/.antigen
|
||||||
|
@ -159,7 +164,6 @@ dfs()
|
||||||
"$DOTFILES/install.sh" -i
|
"$DOTFILES/install.sh" -i
|
||||||
echo 'Done. Please open a new shell to see the changes.'
|
echo 'Done. Please open a new shell to see the changes.'
|
||||||
;;
|
;;
|
||||||
cd ) cd "$DOTFILES" ;;
|
|
||||||
log ) "$DOTFILES/tools/common.sh" "post_log" "INFO" "dfs" "$2" ;;
|
log ) "$DOTFILES/tools/common.sh" "post_log" "INFO" "dfs" "$2" ;;
|
||||||
* ) echo "unknown command \"$1\". available: update, force-update, version, reset, cd, log" ;;
|
* ) echo "unknown command \"$1\". available: update, force-update, version, reset, cd, log" ;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -67,8 +67,8 @@ install_dependencies()
|
||||||
preinstall_check()
|
preinstall_check()
|
||||||
{
|
{
|
||||||
fmt_note "checking requirements ..."
|
fmt_note "checking requirements ..."
|
||||||
mandatory_commands=( "git" "zsh" "curl" "ping" )
|
local mandatory_commands=( "git" "zsh" "curl" )
|
||||||
optional_commands=( "python3" "vim" "tmux" )
|
local optional_commands=( "python3" "vim" "tmux" "ping" )
|
||||||
for i in "${mandatory_commands[@]}"; do
|
for i in "${mandatory_commands[@]}"; do
|
||||||
if [[ ! -x "$(command -v $i)" ]]; then
|
if [[ ! -x "$(command -v $i)" ]]; then
|
||||||
fmt_info "all this utils are required: ${mandatory_commands[@]}"
|
fmt_info "all this utils are required: ${mandatory_commands[@]}"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user