]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - archive.sh
archive.sh: Create a gzipped archive.
[config/dotfiles.git] / archive.sh
1 #!/bin/sh
2
3 # Create an archive of my configuration file which can be uploaded on a
4 # server.
5 #
6 # Usage: ./archive.sh
7
8
9 git_clone() {
10     git clone "$1" "$2" > /dev/null
11     cwd=`pwd`
12     cd "$2" && git remote rm origin && git gc && cd "$cwd"
13 }
14
15 git_clone . tmp/dotfiles
16 for name in browser shell vcs vim x11; do
17     echo cloning $name to tmp/
18     git_clone $name tmp/dotfiles/$name
19 done
20
21 archive=dotfiles.tar.gz
22 echo creating $archive
23 tar cf tmp/$archive -C tmp -z dotfiles
24 echo moving $archive to .
25 mv tmp/$archive .
26
27 rm -rf tmp