stagit-scripts

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

stagit-chdesc (448B)


      1 #!/bin/sh
      2 # Author: zakaria @ zakaria.org
      3 # License: MIT
      4 # Usage: stagit-chdesc <repo> <new_description>
      5 
      6 set -eu
      7 
      8 . /var/git/config.rc
      9 
     10 log() {
     11 	printf '%s\n' "$*" >&2
     12 }
     13 die() {
     14 	log "error: $*"
     15 	printf 'exiting...\n'
     16 	exit 1
     17 }
     18 
     19 REPO="$1"
     20 DESC="$2"
     21 
     22 if [ -z "$REPO" ]; then
     23 	die "no repo name provided"
     24 fi
     25 if [ -z "$DESC" ]; then
     26 	die "no new description provided"
     27 fi
     28 
     29 REPO_PATH="${GIT_REPOS}/${REPO}.git"
     30 
     31 echo "$DESC" > ${REPO_PATH}/description