subgit

Git-submodule alternative with vendoring and multiple remotes
git clone https://git.sinitax.com/sinitax/subgit
Log | Files | Refs | sfeed.txt

subgit (374B)


      1#!/bin/bash
      2
      3set -e
      4
      5if [ "$1" = "-d" ]; then
      6	set -x
      7	shift
      8fi
      9
     10if [ "$1" = "-C" ]; then
     11	cd "$2"
     12	shift
     13	shift
     14fi
     15
     16die() {
     17	echo "$@" 2>&1
     18	exit 1
     19}
     20
     21cmd="$1"
     22shift
     23
     24if [ "$cmd" = "--" ]; then
     25	cmd="run"
     26fi
     27
     28if [ -z "$(which "subgit-$cmd" 2>/dev/null)" ]; then
     29	echo "Unknown command $cmd" 1>&2
     30	exit 1
     31fi
     32
     33trap 'echo "Error at during $cmd"' ERR
     34( source "subgit-$cmd"; )