summary refs log tree commit diff
path: root/home
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--home.txt17
-rwxr-xr-xhome.zsh42
2 files changed, 59 insertions, 0 deletions
diff --git a/home.txt b/home.txt
new file mode 100644
index 00000000..4489872e
--- /dev/null
+++ b/home.txt
@@ -0,0 +1,17 @@
+.bin/sup
+.bin/tup
+.bin/up
+.config/git/config
+.config/git/ignore
+.config/htop/htoprc
+.config/nvim/colors/trivial.vim
+.config/nvim/init.vim
+.config/nvim/syntax/nasm.vim
+.gdbinit
+.gnupg/gpg-agent.conf
+.hushlogin
+.inputrc
+.lldbinit
+.psqlrc
+.ssh/config
+.zshrc
diff --git a/home.zsh b/home.zsh
new file mode 100755
index 00000000..8490a3b5
--- /dev/null
+++ b/home.zsh
@@ -0,0 +1,42 @@
+#!/usr/bin/env zsh
+set -o errexit -o nounset -o pipefail
+
+fail() {
+    echo "$@"
+    exit 1
+}
+
+link() {
+    local relPath srcPath dstPath
+    < home.txt while read relPath; do
+        srcPath="$PWD/home/$relPath"
+        dstPath="$HOME/$relPath"
+        [ -L "$dstPath" ] && continue
+        mkdir -p "$(dirname "$dstPath")"
+        ln -s "$srcPath" "$dstPath"
+        echo "$relPath"
+    done
+}
+
+import() {
+    local relPath srcPath dstPath
+    relPath="$1"
+    srcPath="$HOME/$relPath"
+    dstPath="$PWD/home/$relPath"
+    [ -f "$dstPath" ] && fail "$dstPath exists"
+    mkdir -p "$(dirname "$dstPath")"
+    mv "$srcPath" "$dstPath"
+    ln -s "$dstPath" "$srcPath"
+    echo "$relPath" >> home.txt
+    sort -o home.txt home.txt
+}
+
+prune() {
+    local linkPath
+    find -L ~ -type l -lname "$PWD/*" | while read linkPath; do
+        rm "$linkPath"
+        echo "$linkPath"
+    done
+}
+
+$@
href='/cgit-pink/commit/parsing.c?h=1.3.0&id=10451797fa2370aab6f4146c86e0fa939a9a982b&follow=1'>Fix cgit_parse_url when a repo url is contained in another repo urlJulian Maurice 2014-03-20Makefile: use more reliable git tarball mirrorJason A. Donenfeld 2014-03-20git: update to 1.9.1Christian Hesse