]> git.phdru.name Git - cookiecutter.git/blob - publish2web
Tests(CI): Explicitly list python versions at Travis CI
[cookiecutter.git] / publish2web
1 #! /bin/sh
2
3 if [ -z "$1" ]; then
4    echo "Usage: $0 repoistory [directories]" >&2
5    exit 1
6 fi
7
8 umask 022 &&
9 cd "$1" && source_dir="`pwd`" &&
10
11 if [ ! -d ".git" ]; then
12    echo "$source_dir is not a repoistory (.git isn't found)" >&2
13    exit 1
14 fi &&
15
16 cd "$HOME"/tmp &&
17 dest_dir="`basename \"$source_dir\"`".git &&
18 git clone --bare --config core.sharedRepository=0644 "$source_dir" "$dest_dir" &&
19
20 cd "$dest_dir" &&
21 git gc --aggressive &&
22 git repack -a -d -f --depth=20 --window=250 &&
23 git fsck --strict &&
24 git config receive.updateserverinfo true && git update-server-info &&
25 cp -p "$HOME"/Internet/WWW/htdocs/git.phdru.name/phdru.name/phdru.name.git/git-daemon-export-ok . &&
26 if [ "`cat \"$source_dir\"/.git/description`" = \
27    "Unnamed repository; edit this file 'description' to name the repository." ]
28 then
29    `git var GIT_EDITOR` "$source_dir"/.git/description description
30 else
31    cp -p "$source_dir"/.git/description . && chmod a+r description
32 fi &&
33 if [ -f "$source_dir"/README.html ]; then
34    cp -p "$source_dir"/README.html . && chmod a+r README.html
35 fi &&
36
37 cd "$HOME"/Internet/WWW/htdocs/git.phdru.name &&
38 directories="$2" &&
39 if [ -n "$directories" ]; then
40    mkdir -p "$directories"
41 fi &&
42
43 cd "$HOME"/tmp &&
44 mv "$dest_dir" "$HOME"/Internet/WWW/htdocs/git.phdru.name/"$directories" &&
45 echo "$HOME"/Internet/WWW/htdocs/git.phdru.name/"$directories/$dest_dir" >> "`dirname \"$0\"`"/locate-all.list &&
46
47 umask 077 &&
48 cd "$source_dir" &&
49 if [ -n "$directories" ]; then
50    dest_dir="$directories/$dest_dir"
51 fi &&
52 git remote add web "$HOME"/Internet/WWW/htdocs/git.phdru.name/"$dest_dir" &&
53 exec git push --set-upstream web master