From 47a3723632b82a0d3caf79dbe8ada1eae60dd976 Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Sat, 25 Jul 2020 11:20:55 +0300 Subject: rename to cpt-extra --- repo/git/cpt-add | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 repo/git/cpt-add (limited to 'repo/git/cpt-add') diff --git a/repo/git/cpt-add b/repo/git/cpt-add new file mode 100755 index 0000000..b707555 --- /dev/null +++ b/repo/git/cpt-add @@ -0,0 +1,20 @@ +#!/bin/sh -e +# Commit the current directory as a new package + +case "$1" in + '') set -- . ;; + --help|-h) printf '%s\n' "usage: ${0##*/}"; exit 0; esac + +for pkg; do ( + + cd "$pkg" + 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" + +) done -- cgit v1.2.3