summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Abbott <george@gabbott.dev>2023-11-11 15:41:36 +0000
committerGeorge Abbott <george@gabbott.dev>2023-11-11 15:41:36 +0000
commit4af3fcbd9c812a9f9d583bd502861ba7ca74c26b (patch)
treed66cc098b2f689f4643e719ed260f682c734e375
parent6fff36ec2876beea17ab6d2e878c798906b3c10b (diff)
Add allotment script
l---------all/allotment1
-rwxr-xr-xweb/allotment5
-rwxr-xr-xweb/init-cgit12
3 files changed, 15 insertions, 3 deletions
diff --git a/all/allotment b/all/allotment
new file mode 120000
index 0000000..6c4b9e8
--- /dev/null
+++ b/all/allotment
@@ -0,0 +1 @@
+../web/allotment \ No newline at end of file
diff --git a/web/allotment b/web/allotment
new file mode 100755
index 0000000..5524fe7
--- /dev/null
+++ b/web/allotment
@@ -0,0 +1,5 @@
+#!/bin/sh
+# allotment: edit the allotment diary.
+
+$EDITOR "$WEBSITE_PATH/allotment.html"
+ws-push
diff --git a/web/init-cgit b/web/init-cgit
index 8e730c1..994b407 100755
--- a/web/init-cgit
+++ b/web/init-cgit
@@ -5,6 +5,7 @@
# It will add a remote `cgit` pointing to `git@example.com:/srv/git/repo.git.
# $1 = name of repo - I guess we could get this from the cwd maybe?.
# $2 = description to override repo/description with.
+# $3 = if necessary, a branch to use if not master.
if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
echo "init-cgit NAME DESCRIPTION"
@@ -13,9 +14,9 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
exit 0
fi
-
GIT_USER="git"
SRV_GIT_PATH="/srv/git"
+REMOTE_NAME="cgit"
if [ -z "$BARE_WEBSITE_URL" ] ; then
echo "BARE_WEBSITE_URL must be set"
@@ -30,5 +31,10 @@ if [ ! -z "$2" ] ; then
fi
# Now create `cgit` remote in local repo.
-git remote add cgit "$GIT_USER@$BARE_WEBSITE_URL:$SRV_GIT_PATH/$1"
-git push cgit master
+git remote add "$REMOTE_NAME" "$GIT_USER@$BARE_WEBSITE_URL:$SRV_GIT_PATH/$1"
+
+if [ -z "$3" ] ; then
+ BRANCH=master
+else
+ BRANCH="$3"
+git push "$REMOTE_NAME" "$BRANCH"