diff setup.sh @ 170:95e349996727

Add a script for setting up the shell environment on a naked home. Use a global .hgrc that has a hook for local includes per machine.
author Dirk Olmes <dirk.olmes@codedo.de>
date Sat, 04 Apr 2020 03:53:18 +0200
parents
children efce15db2915
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/setup.sh	Sat Apr 04 03:53:18 2020 +0200
@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+# setup the shell env on a new, naked host
+#
+cd $HOME
+
+replace_with_link() {
+	local target="$1"
+	local source="$2"
+
+	if [[ -f $target ]]; then
+		rm $target
+	fi
+	ln -s $source $target
+}
+
+replace_with_link .zshrc .zsh-env/zshrc
+replace_with_link .hgrc .zsh-env/hgrc
+replace_with_link .nanorc .zsh-env/.nanorc
+replace_with_link .screenrc .zsh-env/.screenrc