aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2020-07-18 22:55:08 +0300
committerCem Keylan <cem@ckyln.com>2020-07-18 22:55:08 +0300
commitae544a41ef41c2a4cf8ece0c0bed38726252e4b4 (patch)
tree800ec2e4e4b3c519456d81c75735398a58ae21eb
parent1dabf5a8d511db458dd529588e57a8ed8185787a (diff)
downloadcpt-extra-ae544a41ef41c2a4cf8ece0c0bed38726252e4b4.tar.gz
kiss-add: add support for adding multiple packages at the same time
-rwxr-xr-xrepo/git/kiss-add25
1 files changed, 16 insertions, 9 deletions
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