stagit-scripts

Personal companion scripts for stagit
git clone _git@git.zakaria.org/stagit-scripts.git
Log | Files | Refs | README

commit 10d169b70b8627356beb206e7737bd2edb41b537
parent 6a1744f6618654165d642bef72a04c05564d2f75
Author: zakaria <e-zk@users.noreply.github.com>
Date:   Mon, 31 Jan 2022 19:36:46 +1000

Add stagit-rm

- Fix some formatting stuff as well

Diffstat:
Mstagit-chdesc | 2+-
Mstagit-newrepo | 2+-
Astagit-rm | 28++++++++++++++++++++++++++++
3 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/stagit-chdesc b/stagit-chdesc @@ -1,5 +1,5 @@ #!/bin/sh -# Author: zakaria / zakaria.org +# Author: zakaria @ zakaria.org # License: MIT # Usage: stagit-chdesc <repo> <new_description> diff --git a/stagit-newrepo b/stagit-newrepo @@ -22,7 +22,7 @@ DESC="${2:-$DEFAULT_DESC}" OWNER="${3:-$DEFAULT_OWNER}" if [ -z "$REPO" ]; then - die "no repo name given" + die "no repo name provided" fi REPO_PATH="${GIT_REPOS}/${REPO}.git" diff --git a/stagit-rm b/stagit-rm @@ -0,0 +1,28 @@ +#!/bin/sh +# Author: zakaria @ zakaria.org +# License: MIT +# Usage: stagit-rm <repo> + +set -eu + +. /var/git/config.rc + +log() { + printf '%s\n' "$*" >&2 +} +die() { + log "error: $*" + printf 'exiting...\n' + exit 1 +} + +REPO="$1" + +if [ -z "$REPO" ]; then + die "no repo name provided" +fi + +REPO_PATH="${GIT_REPOS}/${REPO}.git" + +rm -rvf "$REPO_PATH" +rm -rvf "${WWW_HOME}/${REPO}"