diff options
Diffstat (limited to 'roles/git/files/git-shell-commands/make-public')
-rw-r--r-- | roles/git/files/git-shell-commands/make-public | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/roles/git/files/git-shell-commands/make-public b/roles/git/files/git-shell-commands/make-public deleted file mode 100644 index 52546ee..0000000 --- a/roles/git/files/git-shell-commands/make-public +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2017 Aaron LI <aly@aaronly.me> -# MIT License -# -# Make an existing Git repository public by linking it into -# `repos.public`, which is exported via `cgit`. -# -# 2017-06-19 -# - -. ${HOME}/vars.conf - -if [ $# -ne 1 ]; then - echo "usage: make-public <repository.git>" - exit 1 -fi - -if [ ! -e "${PUBLIC}" ]; then - echo "ERROR: public directory '${PUBLIC}' not exists!" - exit 1 -fi - -project="${1%.[gG][iI][tT]}.git" - -if [ ! -d "${HOME}/${project}" ]; then - echo "ERROR: repository '${project}' not exists!" - exit 3 -elif [ -L "${PUBLIC}/${project}" ]; then - echo "Repository '${project}' already made public." - exit 0 -else - ln -sv ../${project} ${PUBLIC}/${project} - echo "Made repository '${project}' public." - exit 0 -fi - |