aboutsummaryrefslogtreecommitdiffstats
path: root/roles/jails/22_forge/files/git-shell-commands/rename
blob: be791928b9502cdc6ecf64f0b08ceceeaafffc82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
set -e
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"