- update upgrade_system to better support arch and have better error
handling - use dracula for vim, will change - use rootless docker socket if available
This commit is contained in:
parent
dfe35df892
commit
307e957a52
3 changed files with 61 additions and 59 deletions
|
@ -28,6 +28,7 @@ else
|
|||
endif
|
||||
let g:deoplete#enable_at_startup = 1
|
||||
|
||||
Plug 'dracula/vim', { 'as': 'dracula' }
|
||||
Plug 'Chiel92/vim-autoformat'
|
||||
Plug 'Lokaltog/vim-easymotion'
|
||||
Plug 'airblade/vim-gitgutter'
|
||||
|
@ -38,7 +39,6 @@ Plug 'godlygeek/tabular'
|
|||
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' }
|
||||
Plug 'majutsushi/tagbar'
|
||||
Plug 'moll/vim-bbye'
|
||||
Plug 'nanotech/jellybeans.vim'
|
||||
Plug 'rking/ag.vim'
|
||||
Plug 'rust-lang/rust.vim', { 'for': 'rust' }
|
||||
Plug 'scrooloose/nerdcommenter'
|
||||
|
@ -59,7 +59,7 @@ if executable('ag')
|
|||
let $FZF_DEFAULT_COMMAND = 'ag --skip-vcs-ignores --nocolor -g "" -l'
|
||||
endif
|
||||
|
||||
colorscheme jellybeans " Color scheme
|
||||
colorscheme dracula " Color scheme
|
||||
set laststatus=2 " Enable airline
|
||||
let g:airline_theme = 'jellybeans' " Airline color scheme
|
||||
let g:airline#extensions#tabline#enabled = 1 " Enable tab list in airline
|
||||
|
|
|
@ -102,6 +102,11 @@ fi
|
|||
|
||||
alias mv='mv -i'
|
||||
|
||||
# if rootless docker has a unix domain socket, use it!
|
||||
if [ -e "${XDG_RUNTIME_DIR}/docker.sock" ]; then
|
||||
export DOCKER_HOST="unix://${XDG_RUNTIME_DIR}/docker.sock"
|
||||
fi
|
||||
|
||||
if command -v docker-compose &> /dev/null; then
|
||||
alias dco='docker-compose'
|
||||
fi
|
||||
|
|
|
@ -1,72 +1,69 @@
|
|||
#!/bin/bash
|
||||
|
||||
upgrade_system() {
|
||||
case "$(uname | tr '[:upper:]' '[:lower:]')" in
|
||||
'darwin')
|
||||
if command -v brew &> /dev/null; then
|
||||
brew update || return $?
|
||||
brew upgrade || return $?
|
||||
fi
|
||||
;;
|
||||
|
||||
'linux')
|
||||
# Debian/Ubuntu
|
||||
if command -v apt &> /dev/null; then
|
||||
sudo sh -c 'apt update && apt upgrade' || return $?
|
||||
fi
|
||||
|
||||
# Fedora
|
||||
if command -v dnf &> /dev/null; then
|
||||
sudo dnf upgrade || return $?
|
||||
fi
|
||||
|
||||
# Arch
|
||||
if command -v yay &> /dev/null; then
|
||||
yay -Syu || return $?
|
||||
elif command -v pacman &> /dev/null; then
|
||||
sudo pacman -Syu || return $?
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if command -v vim &> /dev/null; then
|
||||
vim -c 'PlugUpgrade | q' || return $?
|
||||
vim -c 'PlugUpdate | sleep 3 | qa' || return $?
|
||||
fi
|
||||
|
||||
(
|
||||
set -e
|
||||
set -euo pipefail
|
||||
|
||||
cd "${ZSH}/custom/plugins"
|
||||
case "$(uname | tr '[:upper:]' '[:lower:]')" in
|
||||
'darwin')
|
||||
if command -v brew &> /dev/null; then
|
||||
brew update
|
||||
brew upgrade
|
||||
fi
|
||||
;;
|
||||
|
||||
for FILE in *; do
|
||||
if ! [ -d "${FILE}" ]; then
|
||||
continue
|
||||
fi
|
||||
'linux')
|
||||
# Debian/Ubuntu
|
||||
if command -v apt &> /dev/null; then
|
||||
sudo sh -c 'apt update && apt upgrade'
|
||||
fi
|
||||
|
||||
(
|
||||
cd "${FILE}"
|
||||
[ -d .git ] || exit 0
|
||||
git pull
|
||||
)
|
||||
done
|
||||
) || return $?
|
||||
# Fedora
|
||||
if command -v dnf &> /dev/null; then
|
||||
sudo dnf upgrade
|
||||
fi
|
||||
|
||||
(
|
||||
set -e
|
||||
# Arch
|
||||
if command -v yay &> /dev/null; then
|
||||
yay -Syu --devel --timeupdate
|
||||
elif command -v pacman &> /dev/null; then
|
||||
sudo pacman -Syu
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
cd "${HOME}/.tmux"
|
||||
git pull
|
||||
if [ -n "${TMUX}" ]; then
|
||||
tmux source-file "${HOME}/.tmux.conf"
|
||||
if command -v vim &> /dev/null; then
|
||||
vim -c 'PlugUpgrade | q'
|
||||
vim -c 'PlugUpdate | sleep 3 | qa'
|
||||
fi
|
||||
)
|
||||
|
||||
if command -v fwupdmgr &> /dev/null; then
|
||||
(
|
||||
set -e
|
||||
cd "${ZSH}/custom/plugins"
|
||||
|
||||
for FILE in *; do
|
||||
if ! [ -d "${FILE}" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
(
|
||||
cd "${FILE}"
|
||||
[ -d .git ] || exit 0
|
||||
git pull
|
||||
)
|
||||
done
|
||||
)
|
||||
|
||||
(
|
||||
cd "${HOME}/.tmux"
|
||||
git pull
|
||||
if [ -n "${TMUX:-}" ]; then
|
||||
tmux source-file "${HOME}/.tmux.conf"
|
||||
fi
|
||||
)
|
||||
|
||||
if command -v fwupdmgr &> /dev/null; then
|
||||
fwupdmgr refresh
|
||||
fwupdmgr upgrade
|
||||
)
|
||||
fi
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue