aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-04-14 18:04:07 +0000
committermerakor <cem@ckyln.com>2020-04-14 18:04:07 +0000
commit6b833795edb8db83b2a786cf3c8209ec95d4b87d (patch)
tree5e4719d6e2012517115a9a6a4ee4daca86da8b5a
parent37402bcb8fdb364289403bd5655de0582a4bb3c9 (diff)
downloadcpt-6b833795edb8db83b2a786cf3c8209ec95d4b87d.tar.gz
kiss: use the current working directory for packages if no argument is specified
These affect: * build * checksum * install * remove FossilOrigin-Name: 930ed3227beb3e2ae5db1c9b9cae6fd090a2565df5d9e3206e6861ad432bca99
-rwxr-xr-xkiss11
1 files changed, 5 insertions, 6 deletions
diff --git a/kiss b/kiss
index b3af1cb..9053c2c 100755
--- a/kiss
+++ b/kiss
@@ -1238,7 +1238,7 @@ args() {
# Parse some arguments earlier to remove the need to duplicate code.
case $action in
- c|checksum|s|search)
+ s|search)
[ "$1" ] || die "'kiss $action' requires an argument"
;;
@@ -1252,8 +1252,6 @@ args() {
;;
i|install|r|remove)
- [ "$1" ] || die "'kiss $action' requires an argument"
-
# Rerun the script with 'su' if the user isn't root.
# Cheeky but 'su' can't be used on shell functions themselves.
[ "$uid" = 0 ] || {
@@ -1263,6 +1261,10 @@ args() {
;;
esac
+ case $action in
+ b|build|c|checksum|i|install|r|remove)
+ [ "$1" ] || set -- "${PWD##*/}" ; esac
+
# Actions can be abbreviated to their first letter. This saves
# keystrokes once you memorize the commands.
case $action in
@@ -1285,9 +1287,6 @@ args() {
;;
b|build)
- # If no arguments were passed, rebuild all packages.
- [ "$1" ] || { cd "$sys_db" && { set +f; set -f -- *; } }
-
pkg_build "${@:?No packages installed}"
;;