dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 6fec6ed9a00055fb7844ff07c5caa66229414d17
parent b663f25b4da4cbe637098e795dba8904cda8aac0
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Fri,  1 Jun 2018 09:05:38 -0400

Include zplug in uu script

Diffstat:
Mlinks/.zshrc | 14++++++++++++--
Mlinks/bin/uu | 29+++++++++++++++++++----------
2 files changed, 31 insertions(+), 12 deletions(-)

diff --git a/links/.zshrc b/links/.zshrc @@ -6,8 +6,18 @@ debug_startup=false #### ZSH OPTIONS # man zshoptions -setopt autopushd extendedglob hist_ignore_dups interactivecomments prompt_subst sh_word_split share_history -unsetopt autocd beep notify nomatch +setopt append_history # zsh sessions append their history to the hist file +setopt autocd # cd into directory if called by name +setopt autopushd # make cd push the old dir to the dir stack +setopt extendedglob # globs (. is file, / is dir) see `man zshexpn` +setopt hist_ignore_dups # ignore duplicate cmds in history +setopt interactivecomments # allow in-line comments in prompt +setopt prompt_subst # perform param exp, cmd subst, arith exp in prompt +setopt share_history # import new commands from the history file +unsetopt beep # beep on error +unsetopt hist_verify # verify before executing cmd from history (e.g. !!) +unsetopt notify # report status of bg jobs immediately +unsetopt nomatch # show error if wildcards do not match any files autoload -Uz add-zsh-hook cdr chpwd_recent_dirs compinit select-bracketed select-quoted diff --git a/links/bin/uu b/links/bin/uu @@ -1,14 +1,18 @@ -#!/bin/bash -UNAMESTR=`uname` +#!/usr/bin/env zsh -echo "## Updating package manager lists and installed packages" -if [[ "$UNAMESTR" == 'Linux' ]]; then +announce() { + echo -e "\n$(tput setaf 3)# $@$(tput sgr0)" +} + +announce "Updating package manager lists and installed packages" +if [ "$(uname)" = "Linux" ]; then sudo apt-get update && \ sudo apt-get upgrade && \ sudo apt-get dist-upgrade && \ sudo apt-get autoremove && \ sudo apt-get clean -elif [[ "$UNAMESTR" == 'Darwin' ]]; then + +elif [ "$(uname)" = "Darwin" ]; then echo "Fetching updates..." brew analytics off brew update && \ @@ -16,26 +20,31 @@ elif [[ "$UNAMESTR" == 'Darwin' ]]; then brew cask upgrade && \ brew cleanup else - echo "Platform not supported" + (>&2 echo "Platform not supported") exit 1 fi -echo "## Updating dotfiles" +announce "Updating dotfiles" cd ~/code/dotfiles && \ git pull; cd - -#echo "## Updating spacemacs" +#announce "Updating spacemacs" ##git pull --rebase && \ #cd ~/.emacs.d && \ #git pull && \ #git submodule sync; git submodule update if command -v conda >/dev/null 2>&1; then - echo "## Upgrading conda packages" + announce "Upgrading conda packages" conda update --all fi if command -v julia >/dev/null 2>&1; then - echo "## Upgrading julia packages" + announce "Upgrading julia packages" julia --color=yes -e 'Pkg.update()' fi + +if [ -d ~/code/zplug ]; then + announce "Upgrading zplug packages" + (zsh -c "source ~/.zshrc && zplug update") +fi