annotate setup.sh @ 182:d74e3821363e

Readme for some basic documentation
author Dirk Olmes <dirk.olmes@codedo.de>
date Sat, 08 Aug 2020 11:40:20 +0200
parents f6df36a328b5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
170
95e349996727 Add a script for setting up the shell environment on a naked home.
Dirk Olmes <dirk.olmes@codedo.de>
parents:
diff changeset
1 #!/bin/bash
95e349996727 Add a script for setting up the shell environment on a naked home.
Dirk Olmes <dirk.olmes@codedo.de>
parents:
diff changeset
2 #
95e349996727 Add a script for setting up the shell environment on a naked home.
Dirk Olmes <dirk.olmes@codedo.de>
parents:
diff changeset
3 # setup the shell env on a new, naked host
95e349996727 Add a script for setting up the shell environment on a naked home.
Dirk Olmes <dirk.olmes@codedo.de>
parents:
diff changeset
4 #
95e349996727 Add a script for setting up the shell environment on a naked home.
Dirk Olmes <dirk.olmes@codedo.de>
parents:
diff changeset
5 cd $HOME
95e349996727 Add a script for setting up the shell environment on a naked home.
Dirk Olmes <dirk.olmes@codedo.de>
parents:
diff changeset
6
95e349996727 Add a script for setting up the shell environment on a naked home.
Dirk Olmes <dirk.olmes@codedo.de>
parents:
diff changeset
7 replace_with_link() {
95e349996727 Add a script for setting up the shell environment on a naked home.
Dirk Olmes <dirk.olmes@codedo.de>
parents:
diff changeset
8 local target="$1"
95e349996727 Add a script for setting up the shell environment on a naked home.
Dirk Olmes <dirk.olmes@codedo.de>
parents:
diff changeset
9 local source="$2"
95e349996727 Add a script for setting up the shell environment on a naked home.
Dirk Olmes <dirk.olmes@codedo.de>
parents:
diff changeset
10
95e349996727 Add a script for setting up the shell environment on a naked home.
Dirk Olmes <dirk.olmes@codedo.de>
parents:
diff changeset
11 if [[ -f $target ]]; then
95e349996727 Add a script for setting up the shell environment on a naked home.
Dirk Olmes <dirk.olmes@codedo.de>
parents:
diff changeset
12 rm $target
95e349996727 Add a script for setting up the shell environment on a naked home.
Dirk Olmes <dirk.olmes@codedo.de>
parents:
diff changeset
13 fi
95e349996727 Add a script for setting up the shell environment on a naked home.
Dirk Olmes <dirk.olmes@codedo.de>
parents:
diff changeset
14 ln -s $source $target
95e349996727 Add a script for setting up the shell environment on a naked home.
Dirk Olmes <dirk.olmes@codedo.de>
parents:
diff changeset
15 }
95e349996727 Add a script for setting up the shell environment on a naked home.
Dirk Olmes <dirk.olmes@codedo.de>
parents:
diff changeset
16
95e349996727 Add a script for setting up the shell environment on a naked home.
Dirk Olmes <dirk.olmes@codedo.de>
parents:
diff changeset
17 replace_with_link .zshrc .zsh-env/zshrc
95e349996727 Add a script for setting up the shell environment on a naked home.
Dirk Olmes <dirk.olmes@codedo.de>
parents:
diff changeset
18 replace_with_link .hgrc .zsh-env/hgrc
95e349996727 Add a script for setting up the shell environment on a naked home.
Dirk Olmes <dirk.olmes@codedo.de>
parents:
diff changeset
19 replace_with_link .nanorc .zsh-env/.nanorc
95e349996727 Add a script for setting up the shell environment on a naked home.
Dirk Olmes <dirk.olmes@codedo.de>
parents:
diff changeset
20 replace_with_link .screenrc .zsh-env/.screenrc
181
f6df36a328b5 also replace the git config
Dirk Olmes <dirk.olmes@codedo.de>
parents: 173
diff changeset
21 replace_with_link .gitconfig .zsh-env/.gitconfig
172
efce15db2915 create a default .hgignore file
Dirk Olmes <dirk.olmes@codedo.de>
parents: 170
diff changeset
22
173
f8c9b13158b8 create a default zshrc for the host
Dirk Olmes <dirk.olmes@codedo.de>
parents: 172
diff changeset
23 touch .zsh-env/zshrc-$HOST
f8c9b13158b8 create a default zshrc for the host
Dirk Olmes <dirk.olmes@codedo.de>
parents: 172
diff changeset
24
172
efce15db2915 create a default .hgignore file
Dirk Olmes <dirk.olmes@codedo.de>
parents: 170
diff changeset
25 cat << EOF > .zsh-env/.hgignore
efce15db2915 create a default .hgignore file
Dirk Olmes <dirk.olmes@codedo.de>
parents: 170
diff changeset
26 syntax: glob
efce15db2915 create a default .hgignore file
Dirk Olmes <dirk.olmes@codedo.de>
parents: 170
diff changeset
27 .hgignore
efce15db2915 create a default .hgignore file
Dirk Olmes <dirk.olmes@codedo.de>
parents: 170
diff changeset
28 zshrc-$HOST
efce15db2915 create a default .hgignore file
Dirk Olmes <dirk.olmes@codedo.de>
parents: 170
diff changeset
29 EOF