aboutsummaryrefslogtreecommitdiffstats
path: root/roles/jails/22_forge/files/git-shell-commands/new
diff options
context:
space:
mode:
authorJan Sydänviita <jan@sydanviita.fi>2026-08-18 15:59:39 +0300
committerJan Sydänviita <jan@sydanviita.fi>2026-08-18 15:59:39 +0300
commite63f07385f9c67395315fe029735fe32d9b16480 (patch)
treebed59ff1d6ea7d959e618088e48e8785b2c9eadd /roles/jails/22_forge/files/git-shell-commands/new
parent076581c53354b51dafc4d5dc7760f0c5ff03344a (diff)
Add forge jail
Diffstat (limited to 'roles/jails/22_forge/files/git-shell-commands/new')
-rw-r--r--roles/jails/22_forge/files/git-shell-commands/new12
1 files changed, 12 insertions, 0 deletions
diff --git a/roles/jails/22_forge/files/git-shell-commands/new b/roles/jails/22_forge/files/git-shell-commands/new
new file mode 100644
index 0000000..ba67bc4
--- /dev/null
+++ b/roles/jails/22_forge/files/git-shell-commands/new
@@ -0,0 +1,12 @@
+#!/bin/sh
+if [ -z "$1" ]; then
+ echo "Usage: new [REPO_NAME]"
+ exit 1
+fi
+if [ -d "$1.git" ]; then
+ echo "Repository $1 already exists"
+ exit 1
+fi
+git init --bare "$1.git"
+echo "$1" > "$1.git/description"
+echo "Created repository $1"