update dotfiles command

This commit is contained in:
Chen Asraf
2021-01-27 23:59:57 +02:00
parent 107b3e4c76
commit a2bafe013a
2 changed files with 37 additions and 0 deletions

View File

@@ -1,5 +1,7 @@
#!/usr/bin/env bash
source $HOME/.dotfiles/colors.sh
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
@@ -9,6 +11,14 @@
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias reload-zsh="source $HOME/.zshrc"
update-dotfiles () {
cwd="$(pwd)"
cd "$HOME/.dotfiles"
echo_cyan "Changed directory to: $HOME/.dotfiles"
git pull
cd "$cwd"
echo_cyan "Returned to previous directory: $cwd"
}
alias dv="cd $HOME/Dev"
alias dt="cd $HOME/Desktop"
alias dl="cd $HOME/Downloads"

27
colors.sh Normal file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# colors
color() {
echo -e "\033[0;$1m$2\033[0m"
}
echo_red() {
color 31 "$1"
}
echo_green() {
color 32 "$1"
}
echo_yellow() {
color 33 "$1"
}
echo_blue() {
color 34 "$1"
}
echo_purple() {
color 35 "$1"
}
echo_cyan() {
color 36 "$1"
}
echo_white() {
color 37 "$1"
}