dot

packages and services management
Log | Files | Refs | README

commit 150d8a3e1e8c9161d9397f58cc60b0c4c9aba1dd
parent 66b30154bfc031a8ccdf2a40c838fe11793025b7
Author: josuah <mail@josuah.net>
Date:   Wed, 21 Sep 2016 19:43:15 -0400

Simplified src script a few

Diffstat:
Mbin/buffers | 3+++
Mbin/src | 24++++++++++--------------
Ms-nail/.mailrc | 2+-
Mshell/.profile | 9++++++---
Mvim/.vimrc | 5+++--
5 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/bin/buffers b/bin/buffers @@ -59,9 +59,11 @@ r | run ) htop | s-nail | rirc | agenda | music ) : ;; vi | vis | less | ex-vi | ex | ed ) path="$(find ./ -type f ! -path '*/.git/*' | fzy)" + [ -z "$path" ] && exit 1 ;; vim ) path="$(find ./ -type d ! -path '*/.git/*' ! -name .git | fzy)" + [ -z "$path" ] && exit 1 ;; * ) read opt @@ -69,6 +71,7 @@ r | run ) then path="$(find -type f ./ | fzy)" opt="${opt##*\*} $path ${opt%%\**}" + [ -z "$path" ] && exit 1 fi ;; esac diff --git a/bin/src b/bin/src @@ -11,6 +11,7 @@ PREFIX="$HOME/.local" CONFIG="${CONFIG-$HOME/Config}" CPATH="${CPATH-$PREFIX/include}" + # FUNCTIONS #------------------------------------------------------------------------------- @@ -55,13 +56,11 @@ PACKAGES" error() { - local msg="$1" printf '%s: \033[1;31m%s\033[0m\n' "$(basename "$0")" "$1" 1>&2 } info() { - local msg="$1" printf '%s: \033[1m%s\033[0m\n' "$(basename "$0")" "$1" 1>&2 } @@ -79,9 +78,6 @@ compile() cd "$PREFIX"; mkdir -p $dirs cd src; build "$name" cd "$PREFIX"; rmdir -p $dirs - - mandb "$PREFIX/man" - mandb "$PREFIX/share/man" } download() @@ -118,6 +114,7 @@ remove() rm -rf "$PROGRAMS/$name" } + # ALGORYTHM #------------------------------------------------------------------------------- @@ -161,15 +158,14 @@ do esac done -# Re-build an index of installed files in $PREFIX -info "Rebuilding index in $PREFIX" +info "Updating index in $PREFIX. This may take a few seconds..." -find "$PREFIX" -type l -exec rm {} \; +find "$PREFIX" -type l -delete; -find "$PROGRAMS" -mindepth 2 -type d ! -path "$PROGRAMS/*/src*" | while read d -do mkdir -p "$PREFIX/${d#$PROGRAMS/*/}" -done - -find "$PROGRAMS" -mindepth 2 -type f ! -path "$PROGRAMS/*/src*" | while read f -do ln -sf "$f" "$PREFIX/${f#$PROGRAMS/*/}" +find "$PROGRAMS" -mindepth 2 ! -path "*/src*" | while read path +do + if [ -d "$path" ] + then mkdir -p "$PREFIX/${path#$PROGRAMS/*/}" + else ln -sf "$path" "$PREFIX/${path#$PROGRAMS/*/}" + fi done diff --git a/s-nail/.mailrc b/s-nail/.mailrc @@ -2,7 +2,7 @@ # ____ ____ _____ \/ / / # / __/___ / __ \ .'__ / /\ / / # __\ \//__// / / // /_/ / / // / -# \___/ \/ \/ \____/ \/ \/ +# \___/ \/ \/ \____/ \/ \/ 2016-09-20 #=============================================================================== # s-nail configuration file diff --git a/shell/.profile b/shell/.profile @@ -188,11 +188,14 @@ extract() } # -# Remove spaces and other nasty characters from $1 recursively +# Remove spaces and other nasty characters from $1, recursively +# sanitize() { - find "$1" | tac | while read -r p - do mv "$p" "$(printf '%s\n' "$p" | sed 's/[^[:alnum:],._/+-]/_/g')" + find . -mindepth 1 | tac | while IFS= read -r p + do mv "$p" "${p%/*}/$(printf %s "${p##*/}" \ + | sed 's/[^[:alnum:],._/+-]/_/g' + )" done } diff --git a/vim/.vimrc b/vim/.vimrc @@ -47,7 +47,8 @@ nmap <leader>' : echo '' \| marks <cr>:' nmap <leader>m : make <cr> nmap <leader>/ :exe ':' . system("swiper '" . expand("%:p") . "'") \ \| redraw!<cr> -nmap <leader>e :exe 'e' . system("find . -type f ! -path '*/.git/*' \| fzy") +nmap <leader>e :pwd \| echo ''<cr>:exe 'e' +\ system("find . -type f ! -path '*/.git/*' \| fzy") \ \| redraw!<cr> " <c>hange <o>ption <...> @@ -68,7 +69,7 @@ nmap [<leader> mzO<Esc>k`z<C-e> nmap ]<leader> mzo<Esc>k`z " Parentheses -vmap <leader>p myomzr\|`zr\`yr/ +vmap <leader>p myomzr\|`zlhr\`ylhr/ " ABBREVIATIONS 2016-09-14