view setup.sh @ 172:efce15db2915

create a default .hgignore file
author Dirk Olmes <dirk.olmes@codedo.de>
date Sat, 04 Apr 2020 04:09:41 +0200
parents 95e349996727
children f8c9b13158b8
line wrap: on
line source

#!/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

cat << EOF > .zsh-env/.hgignore
syntax: glob
.hgignore
zshrc-$HOST
EOF