dot

packages and services management
Log | Files | Refs | README

commit 07a497a4a84b379d728585e058021e21f2aaeeee
parent 7c93c290771da745f09b4f5551fb0948c42b3887
Author: Josuah Demangeonā  ā µ <mail@josuah.net>
Date:   Mon, 13 Mar 2017 10:01:56 +0100

cleaned scripts

Diffstat:
DREADME | 64----------------------------------------------------------------
Mbin/io-edit | 19+++++++++++--------
Ainstall | 63+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 74 insertions(+), 72 deletions(-)

diff --git a/README b/README @@ -1,64 +0,0 @@ -case "$1" in - - -( l | link ) - - cd "${0%/*}" || exit 1 - - find "$PWD" -path "$PWD/.*" ! -path '*/.git*' | while IFS='' read -r path - do - [ -d "$path" ] && mkdir -p "$HOME/${path#$PWD/}" - [ -f "$path" ] && ln -sf "$path" "$HOME/${path#$PWD/}" - done - - find -L ~ -type l -exec rm {} \; - ;; - - -( g | git ) - - mkdir -p ~/git && cd ~/git || exit - - git clone ssh://repo.or.cz/iomenu.git - - git clone http://github.com/josuah/www ~/www & - - git clone http://github.com/josuah/alphabet & - git clone http://github.com/josuah/artisanat & - git clone http://github.com/josuah/bataille-navale & - git clone http://github.com/josuah/build & - git clone http://github.com/josuah/cgr & - git clone http://github.com/josuah/config & - git clone http://github.com/josuah/drawille & - git clone http://github.com/josuah/fs & - git clone http://github.com/josuah/fungus-vs-pathogen & - git clone http://github.com/josuah/hud & - git clone http://github.com/josuah/iode & - git clone http://github.com/josuah/madown & - git clone http://github.com/josuah/miniwi & - git clone http://github.com/josuah/notes & - git clone http://github.com/josuah/puissance-4 & - - wait - ;; - - -( m | mail ) - - mkdir -p "$MAIL/cur" "$MAIL/new" "$MAIL/tmp" - - printf '<address@mail.net> <imap.host.net> <password>:' - read -r a h p - printf '\033[A\033[2K' - printf 'machine %s\nlogin %s\npassword "%s"' "$h" "$a" "$p" > ~/.netrc - chmod 400 ~/.netrc - ;; - - -( 9 | plan9 ) - - wget -O- http://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/plan9port/plan9port-20140306.tgz | - tar -xzf - -C "$HOME" && mv plan9port 9 && cd plan9 || exit 1 - - ./INSTALL -esac diff --git a/bin/io-edit b/bin/io-edit @@ -8,30 +8,33 @@ path() { if [ -f "$1" ] then - printf '%s\n' "$([ -d "${1%/*}" ] && cd "${1%/*}"; pwd)/${1##*/}" + printf '%s\n' "$( + [ -d "${1%/*}" ] && cd "${1%/*}" + pwd + )/${1##*/}" else - [ -f "$CACHE/files" ] && tac "$CACHE/files" | $FILTER - fi | tee -a "$CACHE/files" + [ -f "$CACHE/io/files" ] && tac "$CACHE/files" | $FILTER + fi | tee -a "$CACHE/io/files" } history() { - sort "$CACHE/files" | uniq -d | while IFS='' read -r path + sort "$CACHE/io/files" | uniq -d | while IFS='' read -r path do printf '%s\n' "$( - grep -Fxv "$path" "$CACHE/files" - )" "$path" > "$CACHE/files" + grep -Fxv "$path" "$CACHE/io/files" + )" "$path" > "$CACHE/io/files" done - printf '%s\n' "$(tail "$CACHE/files")" > "$CACHE/files" + printf '%s\n' "$(tail "$CACHE/io/files")" > "$CACHE/files" } main() { mkdir -p "$CACHE" - touch "$CACHE/files" + touch "$CACHE/io/files" file="$(path "$1")" diff --git a/install b/install @@ -0,0 +1,63 @@ +case "$1" in + + +( l | link ) + + cd "${0%/*}" || exit 1 + + find "$PWD" -path "$PWD/.*" ! -path '*/.git*' | while IFS='' read -r path + do + [ -d "$path" ] && mkdir -p "$HOME/${path#$PWD/}" + [ -f "$path" ] && ln -sf "$path" "$HOME/${path#$PWD/}" + done + + find -L ~ -type l -exec rm {} \; + ;; + + +( g | git ) + + mkdir -p ~/git && cd ~/git || exit + + git clone ssh://repo.or.cz/iomenu.git + + git clone http://github.com/josuah/www ~/www & + + git clone http://github.com/josuah/alphabet & + git clone http://github.com/josuah/artisanat & + git clone http://github.com/josuah/bataille-navale & + git clone http://github.com/josuah/build & + git clone http://github.com/josuah/cgr & + git clone http://github.com/josuah/config & + git clone http://github.com/josuah/drawille & + git clone http://github.com/josuah/fungus-vs-pathogen & + git clone http://github.com/josuah/hud & + git clone http://github.com/josuah/iode & + git clone http://github.com/josuah/madown & + git clone http://github.com/josuah/miniwi & + git clone http://github.com/josuah/notes & + git clone http://github.com/josuah/puissance-4 & + + wait + ;; + + +( m | mail ) + + mkdir -p "$MAIL/cur" "$MAIL/new" "$MAIL/tmp" + + printf '<address@mail.net> <imap.host.net> <password>:' + read -r a h p + printf '\033[A\033[2K' + printf 'machine %s\nlogin %s\npassword "%s"' "$h" "$a" "$p" > ~/.netrc + chmod 400 ~/.netrc + ;; + + +( 9 | plan9 ) + + wget -O- http://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/plan9port/plan9port-20140306.tgz | + tar -xzf - -C "$HOME" && mv plan9port 9 && cd plan9 || exit 1 + + ./INSTALL +esac