- 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:
Tony Blyler 2021-05-01 18:45:32 -04:00
parent dfe35df892
commit 307e957a52
3 changed files with 61 additions and 59 deletions

View file

@ -28,6 +28,7 @@ else
endif endif
let g:deoplete#enable_at_startup = 1 let g:deoplete#enable_at_startup = 1
Plug 'dracula/vim', { 'as': 'dracula' }
Plug 'Chiel92/vim-autoformat' Plug 'Chiel92/vim-autoformat'
Plug 'Lokaltog/vim-easymotion' Plug 'Lokaltog/vim-easymotion'
Plug 'airblade/vim-gitgutter' Plug 'airblade/vim-gitgutter'
@ -38,7 +39,6 @@ Plug 'godlygeek/tabular'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' } Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' }
Plug 'majutsushi/tagbar' Plug 'majutsushi/tagbar'
Plug 'moll/vim-bbye' Plug 'moll/vim-bbye'
Plug 'nanotech/jellybeans.vim'
Plug 'rking/ag.vim' Plug 'rking/ag.vim'
Plug 'rust-lang/rust.vim', { 'for': 'rust' } Plug 'rust-lang/rust.vim', { 'for': 'rust' }
Plug 'scrooloose/nerdcommenter' Plug 'scrooloose/nerdcommenter'
@ -59,7 +59,7 @@ if executable('ag')
let $FZF_DEFAULT_COMMAND = 'ag --skip-vcs-ignores --nocolor -g "" -l' let $FZF_DEFAULT_COMMAND = 'ag --skip-vcs-ignores --nocolor -g "" -l'
endif endif
colorscheme jellybeans " Color scheme colorscheme dracula " Color scheme
set laststatus=2 " Enable airline set laststatus=2 " Enable airline
let g:airline_theme = 'jellybeans' " Airline color scheme let g:airline_theme = 'jellybeans' " Airline color scheme
let g:airline#extensions#tabline#enabled = 1 " Enable tab list in airline let g:airline#extensions#tabline#enabled = 1 " Enable tab list in airline

View file

@ -102,6 +102,11 @@ fi
alias mv='mv -i' 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 if command -v docker-compose &> /dev/null; then
alias dco='docker-compose' alias dco='docker-compose'
fi fi

View file

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