Summary Files Commits Branches @commit @diff @stats
path: root / scripts / logo
diff options
context:
space:
mode:
1 files changed, 37 insertions, 0 deletions
-rwxr-xr-xscripts/logo37
diff --git a/scripts/logo b/scripts/logo
new file mode 100755
index 0000000..d380e00
--- /dev/null
+++ b/scripts/logo
@@ -0,0 +1,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