aboutsummaryrefslogtreecommitdiff
path: root/repo/git
diff options
context:
space:
mode:
Diffstat (limited to 'repo/git')
-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