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