annotate 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
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
172
efce15db2915 create a default .hgignore file
Dirk Olmes <dirk.olmes@codedo.de>
parents: 170
diff changeset
21
efce15db2915 create a default .hgignore file
Dirk Olmes <dirk.olmes@codedo.de>
parents: 170
diff changeset
22 cat << EOF > .zsh-env/.hgignore
efce15db2915 create a default .hgignore file
Dirk Olmes <dirk.olmes@codedo.de>
parents: 170
diff changeset
23 syntax: glob
efce15db2915 create a default .hgignore file
Dirk Olmes <dirk.olmes@codedo.de>
parents: 170
diff changeset
24 .hgignore
efce15db2915 create a default .hgignore file
Dirk Olmes <dirk.olmes@codedo.de>
parents: 170
diff changeset
25 zshrc-$HOST
efce15db2915 create a default .hgignore file
Dirk Olmes <dirk.olmes@codedo.de>
parents: 170
diff changeset
26 EOF