aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Hovorka <[email protected]>2017-09-04 13:42:23 -0600
committerAdam Hovorka <[email protected]>2017-09-04 13:42:23 -0600
commit8ae9c465242c5e379877a15832043113021d714e (patch)
treee7d1eabb895ee5dc954dc88ca3d6896b0c8ffadc
parent8916659e0e1cb67b860373f2d094445bb1f657aa (diff)
Switch from stowsh to dotbot
-rw-r--r--.gitignore1
-rw-r--r--.gitmodules3
-rw-r--r--base.yaml19
-rw-r--r--base/.hushlogin0
-rw-r--r--base/capsesc (renamed from base/.capsesc)0
-rwxr-xr-xbase/dot5
-rw-r--r--base/vim/colors/base16-default-dark.vim (renamed from base/.vim/colors/base16-default-dark.vim)0
-rw-r--r--base/vim/doc/matchit.txt (renamed from base/.vim/doc/matchit.txt)0
-rw-r--r--base/vim/doc/tags (renamed from base/.vim/doc/tags)0
-rw-r--r--base/vim/ftdetect/json.vim (renamed from base/.vim/ftdetect/json.vim)0
-rw-r--r--base/vim/ftplugin/json.vim (renamed from base/.vim/ftplugin/json.vim)0
-rw-r--r--base/vim/ftplugin/php.vim (renamed from base/.vim/ftplugin/php.vim)0
-rw-r--r--base/vim/indent/json.vim (renamed from base/.vim/indent/json.vim)0
-rw-r--r--base/vim/indent/php.vim (renamed from base/.vim/indent/php.vim)0
-rw-r--r--base/vim/syntax/json.vim (renamed from base/.vim/syntax/json.vim)0
-rw-r--r--base/vim/undo-dir/%home%adam%dotfiles%dotfiles%base.yamlbin0 -> 561 bytes
-rw-r--r--base/vimrc (renamed from base/.vimrc)0
-rw-r--r--base/zsh/aliases.zsh (renamed from base/.zsh/aliases.zsh)0
-rw-r--r--base/zsh/async (renamed from base/.zsh/async)0
-rw-r--r--base/zsh/colors.zsh (renamed from base/.zsh/colors.zsh)0
-rw-r--r--base/zsh/completion.zsh (renamed from base/.zsh/completion.zsh)0
-rw-r--r--base/zsh/correction.zsh (renamed from base/.zsh/correction.zsh)0
-rw-r--r--base/zsh/fancy-man.zsh (renamed from base/.zsh/fancy-man.zsh)0
-rw-r--r--base/zsh/fasd.zsh (renamed from base/.zsh/fasd.zsh)0
-rw-r--r--base/zsh/fast-syntax-highlighting/fast-highlight (renamed from base/.zsh/fast-syntax-highlighting/fast-highlight)0
-rw-r--r--base/zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh (renamed from base/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh)0
-rw-r--r--base/zsh/functions.zsh (renamed from base/.zsh/functions.zsh)0
-rw-r--r--base/zsh/history.zsh (renamed from base/.zsh/history.zsh)0
-rw-r--r--base/zsh/k.zsh (renamed from base/.zsh/k.zsh)0
-rw-r--r--base/zsh/prompt.zsh (renamed from base/.zsh/prompt.zsh)0
-rw-r--r--base/zsh/prompt_pure_setup (renamed from base/.zsh/prompt_pure_setup)0
-rw-r--r--base/zsh/stack.zsh (renamed from base/.zsh/stack.zsh)0
-rw-r--r--base/zsh/tipz.zsh (renamed from base/.zsh/tipz.zsh)0
-rw-r--r--base/zshrc (renamed from base/.zshrc)0
m---------dotbot0
-rwxr-xr-xinstall19
-rwxr-xr-xstowsh182
37 files changed, 47 insertions, 182 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..81e0b3d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.dot.args
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..1ce5c11
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "dotbot"]
+ path = dotbot
+ url = https://github.com/anishathalye/dotbot
diff --git a/base.yaml b/base.yaml
new file mode 100644
index 0000000..fe8240c
--- /dev/null
+++ b/base.yaml
@@ -0,0 +1,19 @@
+- defaults:
+ link:
+ create: true
+ relink: true
+ force: true
+ relative: true
+
+- clean: ['~']
+
+- link:
+ ~/.bin/dot: base/dot
+ ~/.capsesc: base/capsesc
+ ~/.vim: base/vim
+ ~/.vimrc: base/vimrc
+ ~/.zsh: base/zsh
+ ~/.zshrc: base/zshrc
+
+- shell:
+ - touch ~/.hushlogin
diff --git a/base/.hushlogin b/base/.hushlogin
deleted file mode 100644
index e69de29..0000000
--- a/base/.hushlogin
+++ /dev/null
diff --git a/base/.capsesc b/base/capsesc
index 53fe642..53fe642 100644
--- a/base/.capsesc
+++ b/base/capsesc
diff --git a/base/dot b/base/dot
new file mode 100755
index 0000000..c491cda
--- /dev/null
+++ b/base/dot
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+cd $HOME/.dotfiles
+git pull
+./install `cat .dot.args`
diff --git a/base/.vim/colors/base16-default-dark.vim b/base/vim/colors/base16-default-dark.vim
index ea529ec..ea529ec 100644
--- a/base/.vim/colors/base16-default-dark.vim
+++ b/base/vim/colors/base16-default-dark.vim
diff --git a/base/.vim/doc/matchit.txt b/base/vim/doc/matchit.txt
index 8a3a96e..8a3a96e 100644
--- a/base/.vim/doc/matchit.txt
+++ b/base/vim/doc/matchit.txt
diff --git a/base/.vim/doc/tags b/base/vim/doc/tags
index 4ccdc87..4ccdc87 100644
--- a/base/.vim/doc/tags
+++ b/base/vim/doc/tags
diff --git a/base/.vim/ftdetect/json.vim b/base/vim/ftdetect/json.vim
index b4a5cd7..b4a5cd7 100644
--- a/base/.vim/ftdetect/json.vim
+++ b/base/vim/ftdetect/json.vim
diff --git a/base/.vim/ftplugin/json.vim b/base/vim/ftplugin/json.vim
index 3ee1062..3ee1062 100644
--- a/base/.vim/ftplugin/json.vim
+++ b/base/vim/ftplugin/json.vim
diff --git a/base/.vim/ftplugin/php.vim b/base/vim/ftplugin/php.vim
index 3c498a7..3c498a7 100644
--- a/base/.vim/ftplugin/php.vim
+++ b/base/vim/ftplugin/php.vim
diff --git a/base/.vim/indent/json.vim b/base/vim/indent/json.vim
index 7873d65..7873d65 100644
--- a/base/.vim/indent/json.vim
+++ b/base/vim/indent/json.vim
diff --git a/base/.vim/indent/php.vim b/base/vim/indent/php.vim
index 3c498a7..3c498a7 100644
--- a/base/.vim/indent/php.vim
+++ b/base/vim/indent/php.vim
diff --git a/base/.vim/syntax/json.vim b/base/vim/syntax/json.vim
index 3423eba..3423eba 100644
--- a/base/.vim/syntax/json.vim
+++ b/base/vim/syntax/json.vim
diff --git a/base/vim/undo-dir/%home%adam%dotfiles%dotfiles%base.yaml b/base/vim/undo-dir/%home%adam%dotfiles%dotfiles%base.yaml
new file mode 100644
index 0000000..ada8e68
--- /dev/null
+++ b/base/vim/undo-dir/%home%adam%dotfiles%dotfiles%base.yaml
Binary files differ
diff --git a/base/.vimrc b/base/vimrc
index 3a4b16a..3a4b16a 100644
--- a/base/.vimrc
+++ b/base/vimrc
diff --git a/base/.zsh/aliases.zsh b/base/zsh/aliases.zsh
index 21544af..21544af 100644
--- a/base/.zsh/aliases.zsh
+++ b/base/zsh/aliases.zsh
diff --git a/base/.zsh/async b/base/zsh/async
index d11a99a..d11a99a 100644
--- a/base/.zsh/async
+++ b/base/zsh/async
diff --git a/base/.zsh/colors.zsh b/base/zsh/colors.zsh
index 9c8e32b..9c8e32b 100644
--- a/base/.zsh/colors.zsh
+++ b/base/zsh/colors.zsh
diff --git a/base/.zsh/completion.zsh b/base/zsh/completion.zsh
index f9e452d..f9e452d 100644
--- a/base/.zsh/completion.zsh
+++ b/base/zsh/completion.zsh
diff --git a/base/.zsh/correction.zsh b/base/zsh/correction.zsh
index ce25627..ce25627 100644
--- a/base/.zsh/correction.zsh
+++ b/base/zsh/correction.zsh
diff --git a/base/.zsh/fancy-man.zsh b/base/zsh/fancy-man.zsh
index 05843dc..05843dc 100644
--- a/base/.zsh/fancy-man.zsh
+++ b/base/zsh/fancy-man.zsh
diff --git a/base/.zsh/fasd.zsh b/base/zsh/fasd.zsh
index eb96ab0..eb96ab0 100644
--- a/base/.zsh/fasd.zsh
+++ b/base/zsh/fasd.zsh
diff --git a/base/.zsh/fast-syntax-highlighting/fast-highlight b/base/zsh/fast-syntax-highlighting/fast-highlight
index 70c8867..70c8867 100644
--- a/base/.zsh/fast-syntax-highlighting/fast-highlight
+++ b/base/zsh/fast-syntax-highlighting/fast-highlight
diff --git a/base/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh b/base/zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
index 235d425..235d425 100644
--- a/base/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
+++ b/base/zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
diff --git a/base/.zsh/functions.zsh b/base/zsh/functions.zsh
index d2905ad..d2905ad 100644
--- a/base/.zsh/functions.zsh
+++ b/base/zsh/functions.zsh
diff --git a/base/.zsh/history.zsh b/base/zsh/history.zsh
index f21023d..f21023d 100644
--- a/base/.zsh/history.zsh
+++ b/base/zsh/history.zsh
diff --git a/base/.zsh/k.zsh b/base/zsh/k.zsh
index e7dc9fb..e7dc9fb 100644
--- a/base/.zsh/k.zsh
+++ b/base/zsh/k.zsh
diff --git a/base/.zsh/prompt.zsh b/base/zsh/prompt.zsh
index 2e4dca9..2e4dca9 100644
--- a/base/.zsh/prompt.zsh
+++ b/base/zsh/prompt.zsh
diff --git a/base/.zsh/prompt_pure_setup b/base/zsh/prompt_pure_setup
index d9b7f2d..d9b7f2d 100644
--- a/base/.zsh/prompt_pure_setup
+++ b/base/zsh/prompt_pure_setup
diff --git a/base/.zsh/stack.zsh b/base/zsh/stack.zsh
index 444b88d..444b88d 100644
--- a/base/.zsh/stack.zsh
+++ b/base/zsh/stack.zsh
diff --git a/base/.zsh/tipz.zsh b/base/zsh/tipz.zsh
index bb1e224..bb1e224 100644
--- a/base/.zsh/tipz.zsh
+++ b/base/zsh/tipz.zsh
diff --git a/base/.zshrc b/base/zshrc
index b2ddd15..b2ddd15 100644
--- a/base/.zshrc
+++ b/base/zshrc
diff --git a/dotbot b/dotbot
new file mode 160000
+Subproject fe9ca6f5ede35d16f28e0c5db781fb39437fd17
diff --git a/install b/install
new file mode 100755
index 0000000..ed8b710
--- /dev/null
+++ b/install
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+
+set -e
+
+DEFAULT_CONFIG_PREFIX="base"
+CONFIG_SUFFIX=".yaml"
+DOTBOT_DIR="dotbot"
+
+DOTBOT_BIN="bin/dotbot"
+BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+cd "${BASEDIR}"
+git submodule update --init --recursive "${DOTBOT_DIR}"
+
+for conf in ${DEFAULT_CONFIG_PREFIX} ${@}; do
+ "${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${conf}${CONFIG_SUFFIX}"
+done
+
+echo ${@} > .dot.args
diff --git a/stowsh b/stowsh
deleted file mode 100755
index af3c7b1..0000000
--- a/stowsh
+++ /dev/null
@@ -1,182 +0,0 @@
-#!/usr/bin/env bash
-
-_runcommands() {
- local prefix=''
- if [[ $DRYRUN == 1 ]] || [[ $VERBOSE -gt 1 ]]; then
- echo "$@"
- fi
- if [[ $DRYRUN != 1 ]]; then
- eval "$@"
- fi
-}
-
-echoerr() {
- printf "%s\n" "$*" >&2;
-}
-
-deperr() {
- echoerr "stowsh requires $1"
-}
-
-stowsh_setpaths() {
- if command -v grealpath >/dev/null 2>&1; then
- rpcmd="grealpath"
- elif command -v realpath >/dev/null 2>&1; then
- rpcmd="realpath"
- else
- deperr "GNU coreutils"
- return 1
- fi
- if ! strings "$(which "$rpcmd")" | grep -q "GNU coreutils" ; then
- deperr "GNU coreutils"
- return 1
- fi
- if command -v gfind >/dev/null 2>&1; then
- findcmd="gfind"
- elif command -v find >/dev/null 2>&1; then
- findcmd="find"
- else
- deperr "GNU findutils"
- return 1
- fi
- if ! strings "$(which "$findcmd")" | grep -q "GNU findutils" ; then
- deperr "GNU findutils"
- return 1
- fi
-}
-
-stowsh_install() {
- stowsh_setpaths || return 1
- local pkg=$1
- local target
- target=$( "$rpcmd" "${2-$PWD}" )
- local commands=()
-
- (
- cd "$pkg" || return 1
- dirs="$($findcmd . -mindepth 1 -type d | sed "s|./||")"
- for d in $dirs ; do
- commands+=("mkdir -p '$target/$d'")
- done
-
- local files
- files="$($findcmd . -type f -or -type l | sed "s|./||")"
- for f in $files ; do
- local targetf="$target/$f"
- local thisdir
- thisdir=$(dirname "$targetf")
- local relative
- relative=$($rpcmd "$f" --relative-to="$thisdir" --canonicalize-missing)
- if [[ ! -f "$targetf" ]] ; then
- commands+=("ln -s '$relative' '$targetf'")
- else
- echoerr "$targetf already exists."
- if [[ ! $SKIP -eq 1 ]]; then
- echoerr "Aborting. Rerun with the -s flag to skip errors.";
- return
- fi
- fi
- done
- for cmd in "${commands[@]}"; do
- _runcommands "$cmd"
- done;
- )
-}
-
-stowsh_uninstall() {
- stowsh_setpaths || return 1
- local pkg=$1
- local target
- target=$( "$rpcmd" "${2-$PWD}" )
- local commands=()
-
- (
- cd "$pkg" || return 1
- local files
- files="$($findcmd . -type f -or -type l | sed "s|./||")"
- for f in $files ; do
- local targetf="$target/$f"
- if [[ $($rpcmd "$targetf") == $(realpath "$f") ]] ; then
- commands+=("rm '$targetf'")
- elif [[ -f "$targetf" ]] ; then
- echoerr "$targetf does not point to to $(realpath "$f")."
- if [[ ! $SKIP -eq 1 ]]; then
- echoerr "Aborting. Rerun with the -s flag to skip errors.";
- return
- fi
- elif [[ ! -f "$targetf" ]] ; then
- echoerr "$targetf does not exist. Nothing to do."
- if [[ ! $SKIP -eq 1 ]]; then
- echoerr "Aborting. Rerun with the -s flag to skip errors.";
- return
- fi
- fi
- done
-
- dirs="$($findcmd . -mindepth 1 -type d | sed "s|./||")"
- for d in $dirs ; do
- commands+=("[[ -d '$target/$d' ]] && $findcmd '$target/$d' -type d -empty -delete")
- done
- for cmd in "${commands[@]}"; do
- _runcommands "$cmd"
- done;
- )
-}
-
-stowsh_help() {
- echo "Usage: $0 [-D] [-n] [-s] [-v[v]] [-t TARGET] PACKAGES..."
-}
-
-if [ "$0" = "$BASH_SOURCE" ]; then
- UNINSTALL=0
- DRYRUN=0
- SKIP=0
- TARGET="$PWD"
- PACKAGES=()
- while [[ "$@" ]]; do
- if [[ $1 =~ ^- ]]; then
- OPTIND=1
- while getopts ":vhDsnt:" opt; do
- case $opt in
- h)
- stowsh_help
- exit 0
- ;;
- D) UNINSTALL=1
- ;;
- n) DRYRUN=1
- ;;
- s) SKIP=1
- ;;
- v) VERBOSE=$((VERBOSE + 1))
- ;;
- t) TARGET="$OPTARG"
- ;;
- *) echo "'$OPTARG' is an invalid option/flag"
- exit 1
- ;;
- esac
- done
- shift $((OPTIND-1))
- else
- PACKAGES+=("$1")
- shift
- fi
- done
-
- if [[ ${#PACKAGES[@]} -eq 0 ]] ; then
- stowsh_help
- exit 1
- fi
-
- for i in ${!PACKAGES[*]}; do
- pkg=${PACKAGES[$i]}
- if [[ $UNINSTALL -eq 1 ]]; then
- if [[ $VERBOSE -gt 0 ]] ; then echoerr "Uninstalling $pkg from $TARGET" ; fi
- stowsh_uninstall "$pkg" "$TARGET"
- else
- if [[ $VERBOSE -gt 0 ]] ; then echoerr "Installing $pkg to $TARGET" ; fi
- stowsh_install "$pkg" "$TARGET"
- fi
- done
-fi