Summary Files Commits Branches @commit @diff @stats
path: root / scripts / desc
blob: ee7c13bf4a43c7449619579a052049a453e1c0cf (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
#!/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 [ -z "$2" ]
then
	printf 'Description: '
	read
	set "$1" "$REPLY"
fi

# Beware of https://stackoverflow.com/questions/53465980/how-to-keep-parameter-with-spaces-when-running-remote-script-file-with-ssh
cd "$1" && \
git config set --file ./config gitweb.description "$2"