aboutsummaryrefslogtreecommitdiffstats
path: root/roles/jails/22_forge/files/git-shell-commands/rename
diff options
context:
space:
mode:
Diffstat (limited to 'roles/jails/22_forge/files/git-shell-commands/rename')
-rw-r--r--roles/jails/22_forge/files/git-shell-commands/rename15
1 files changed, 15 insertions, 0 deletions
diff --git a/roles/jails/22_forge/files/git-shell-commands/rename b/roles/jails/22_forge/files/git-shell-commands/rename
new file mode 100644
index 0000000..2d1f73e
--- /dev/null
+++ b/roles/jails/22_forge/files/git-shell-commands/rename
@@ -0,0 +1,15 @@
+#!/bin/sh
+if [ -z "$1" ] || [ -z "$2" ]; then
+ echo "Usage: rename [OLD_NAME] [NEW_NAME]"
+ exit 1
+fi
+if [ ! -d "$1.git" ]; then
+ echo "Repository $1 does not exist"
+ exit 1
+fi
+if [ -d "$2.git" ]; then
+ echo "Repository $2 already exists"
+ exit 1
+fi
+mv "$1.git" "$2.git"
+echo "Renamed $1 to $2"