From ae544a41ef41c2a4cf8ece0c0bed38726252e4b4 Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Sat, 18 Jul 2020 22:55:08 +0300 Subject: kiss-add: add support for adding multiple packages at the same time --- repo/git/kiss-add | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'repo/git/kiss-add') diff --git a/repo/git/kiss-add b/repo/git/kiss-add index 3f29946..b707555 100755 --- 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 -- cgit v1.2.3