Summary Files Commits Branches @commit @diff @stats
path: root / scripts / logo
blob: d380e0073a1386a0c6615c751d1d7336e8ff8c32 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash

if [ -z "$1" ]
then
	printf 'Repository: '
	read
	set "$REPLY"
fi

if [ ! -f "$1/HEAD" ]
then
	echo 'Not a repository!'
	exit 1
fi

if [ ! -w "$1/HEAD" ]
then
	echo 'Read-only repository!'
	exit 2
fi

if [ -z "$2" ]
then
	printf 'Logo URL  : '
	read
	set "$1" "$REPLY"
fi

if cd "$1"
then
	if [ "$2" = 'initial' ]
	then
		git config unset --file ./config cgit.logo
	else
		git config set --file ./config cgit.logo "$2"
	fi
fi