#!/bin/sh # Commit the current directory as a new package case "$1" in --help|-h) printf '%s\n' "usage: ${0##*/}"; exit 0; esac read -r ver _ < version || { printf '%s\n' "could not find version file, are you on a package directory?" exit 1 } # Unstage all changes and stage the current directory git reset; git add . git commit -m "${PWD##*/}: add new package at $ver"