cpt-extra

Extra utilities for cpt
git clone git://git.carbslinux.org/cpt-extra
Log | Files | Refs | README | LICENSE

commit ae544a41ef41c2a4cf8ece0c0bed38726252e4b4
parent 1dabf5a8d511db458dd529588e57a8ed8185787a
Author: Cem Keylan <cem@ckyln.com>
Date:   Sat, 18 Jul 2020 22:55:08 +0300

kiss-add: add support for adding multiple packages at the same time

Diffstat:
Mrepo/git/kiss-add | 25++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/repo/git/kiss-add b/repo/git/kiss-add @@ -1,13 +1,20 @@ -#!/bin/sh +#!/bin/sh -e # Commit the current directory as a new package -case "$1" in --help|-h) printf '%s\n' "usage: ${0##*/}"; exit 0; esac +case "$1" in + '') set -- . ;; + --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 -} +for pkg; do ( -# Unstage all changes and stage the current directory -git reset; git add . -git commit -m "${PWD##*/}: add new package at $ver" + 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