- 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,42 +1,43 @@
|
|||
#!/bin/bash
|
||||
|
||||
upgrade_system() {
|
||||
(
|
||||
set -euo pipefail
|
||||
|
||||
case "$(uname | tr '[:upper:]' '[:lower:]')" in
|
||||
'darwin')
|
||||
if command -v brew &> /dev/null; then
|
||||
brew update || return $?
|
||||
brew upgrade || return $?
|
||||
brew update
|
||||
brew upgrade
|
||||
fi
|
||||
;;
|
||||
|
||||
'linux')
|
||||
# Debian/Ubuntu
|
||||
if command -v apt &> /dev/null; then
|
||||
sudo sh -c 'apt update && apt upgrade' || return $?
|
||||
sudo sh -c 'apt update && apt upgrade'
|
||||
fi
|
||||
|
||||
# Fedora
|
||||
if command -v dnf &> /dev/null; then
|
||||
sudo dnf upgrade || return $?
|
||||
sudo dnf upgrade
|
||||
fi
|
||||
|
||||
# Arch
|
||||
if command -v yay &> /dev/null; then
|
||||
yay -Syu || return $?
|
||||
yay -Syu --devel --timeupdate
|
||||
elif command -v pacman &> /dev/null; then
|
||||
sudo pacman -Syu || return $?
|
||||
sudo pacman -Syu
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if command -v vim &> /dev/null; then
|
||||
vim -c 'PlugUpgrade | q' || return $?
|
||||
vim -c 'PlugUpdate | sleep 3 | qa' || return $?
|
||||
vim -c 'PlugUpgrade | q'
|
||||
vim -c 'PlugUpdate | sleep 3 | qa'
|
||||
fi
|
||||
|
||||
(
|
||||
set -e
|
||||
|
||||
cd "${ZSH}/custom/plugins"
|
||||
|
||||
for FILE in *; do
|
||||
|
@ -50,23 +51,19 @@ upgrade_system() {
|
|||
git pull
|
||||
)
|
||||
done
|
||||
) || return $?
|
||||
)
|
||||
|
||||
(
|
||||
set -e
|
||||
|
||||
cd "${HOME}/.tmux"
|
||||
git pull
|
||||
if [ -n "${TMUX}" ]; then
|
||||
if [ -n "${TMUX:-}" ]; then
|
||||
tmux source-file "${HOME}/.tmux.conf"
|
||||
fi
|
||||
)
|
||||
|
||||
if command -v fwupdmgr &> /dev/null; then
|
||||
(
|
||||
set -e
|
||||
fwupdmgr refresh
|
||||
fwupdmgr upgrade
|
||||
)
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue