Compare commits
4 commits
Author | SHA1 | Date | |
---|---|---|---|
71d0bc5445 | |||
5b2422cf21 | |||
61c1cdaf52 | |||
1fc7d00b82 |
6 changed files with 29 additions and 9 deletions
4
delete
4
delete
|
@ -7,11 +7,11 @@ if [[ -z "$1" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -d "$1.git" ]]; then
|
||||
if [[ ! -d "$1" ]]; then
|
||||
echo "Repo $1 doesn't exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rf "$1.git"
|
||||
rm -rf "$1"
|
||||
echo "Successfully deleted repository $1"
|
||||
|
||||
|
|
|
@ -7,10 +7,10 @@ if [[ -z "$1" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -d "$1.git" ]]; then
|
||||
if [[ ! -d "$1" ]]; then
|
||||
echo "Repo $1 doesn't exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
vim "$1.git/description"
|
||||
vim "$1/description"
|
||||
|
||||
|
|
1
help
1
help
|
@ -11,5 +11,6 @@ Welcome to the Brawner home private git server. The available commands are liste
|
|||
new [REPOSITORY_NAME] - create a new repository
|
||||
notify-jenkins [REPOSITORY_NAME] - configure a repository to notify Jenkins of new commits
|
||||
rename [OLD_REPOSITORY_NAME] [NEW_REPOSITORY_NAME] - rename a repository
|
||||
set-main [REPOSITORY_NAME] - rename a repository's master branch to main
|
||||
|
||||
EOF
|
||||
|
|
6
new
6
new
|
@ -7,12 +7,12 @@ if [[ -z "$1" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -d "$1.git" ]]; then
|
||||
if [[ -d "$1" ]]; then
|
||||
echo "Repo $1 already exists"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
/usr/bin/git init --bare "$1.git"
|
||||
/usr/bin/git -C "$1.git" config http.receivepack true
|
||||
/usr/bin/git init --bare "$1"
|
||||
/usr/bin/git -C "$1" config http.receivepack true
|
||||
echo "Successfully created repository $1"
|
||||
|
||||
|
|
4
rename
4
rename
|
@ -10,11 +10,11 @@ if [[ -z "$2" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -d "$2.git" ]]; then
|
||||
if [[ -d "$2" ]]; then
|
||||
echo "Repo $2 already exists"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mv "$1.git" "$2.git"
|
||||
mv "$1" "$2"
|
||||
echo "Successfully renamed repository $1 to $2"
|
||||
|
||||
|
|
19
set-main
Executable file
19
set-main
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
source "$(dirname "$0")/pre-script"
|
||||
|
||||
if [[ -z "$1" ]]; then
|
||||
echo "Please enter a repository name"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -d "$1" ]]; then
|
||||
echo "Repo $1 doesn't exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RET="$(pwd)"
|
||||
cd $1
|
||||
git symbolic-ref HEAD refs/heads/main
|
||||
cd "$RET"
|
||||
|
Loading…
Reference in a new issue