#!/usr/bin/env zsh set -e mkmod=$0:h:a/mk-mod vcsurl=$1 vcspath=$2 modbase=$3 ( cd $vcspath ; git tag ) | while read version ; do [[ $version =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]] || continue cols=(${(s:.:)version}) v=${cols[1]} modname=$modbase [[ $v == v0 || $v == v1 ]] || modname=${modname}/$v $mkmod $vcsurl $vcspath $modname $version done